Qbasicnews.com
December 15, 2019, 09:27:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2 3 ... 6
  Print  
Author Topic: wormhole  (Read 29047 times)
xteraco
Ancient QBer
****
Posts: 450



WWW
« on: March 26, 2005, 08:52:15 PM »

i got a challange, make a wormhole effect in as few lines as possible..you can use any method you want

rulez:
1.cannot use :
2.code must be commented
3.code must be short as possible

ok, thems the rules.. have tons of fun :wink:
Logged

url=http://www.random-seed.net][/url]
Mitth'raw'nuruodo
Ancient Guru
****
Posts: 515



WWW
« Reply #1 on: March 26, 2005, 09:51:55 PM »

Define wormhole.

Technically you can't really see a wormhole...

Do you mean like something out of Star Trek? Stargate? Or like a plasma like worm that wiggles around on the screen?
Logged

i]"But...it was so beautifully done"[/i]
thegrogen
Ancient QBer
****
Posts: 444



« Reply #2 on: March 26, 2005, 10:00:43 PM »

I think he means something like the Wormhole DirectDraw demo that comes with early versions of the DirectX SDK. (the spacetime curvature thing with a grid and a hole in the middle)
Logged

.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Mitth'raw'nuruodo
Ancient Guru
****
Posts: 515



WWW
« Reply #3 on: March 26, 2005, 10:01:53 PM »

Nope never seen it
Logged

i]"But...it was so beautifully done"[/i]
thegrogen
Ancient QBer
****
Posts: 444



« Reply #4 on: March 26, 2005, 10:03:07 PM »

Hmmmm. Try to get your hands on the C++ version of the DirectX 7.0 SDK. It should have it.
Logged

.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Mitth'raw'nuruodo
Ancient Guru
****
Posts: 515



WWW
« Reply #5 on: March 26, 2005, 10:05:42 PM »

Well, I don't feel like doing some 3D right now anyways so this is my last post here, sorry xteraco. :roll:
Logged

i]"But...it was so beautifully done"[/i]
shiftLynx
Wandering Guru
***
Posts: 340



WWW
« Reply #6 on: March 26, 2005, 10:12:28 PM »

As far as I know, the wormhole effect he means is a tunnel effect. This has got me thinking and maybe I'll try and make something... but I'm busy with other stuff. Smiley

Wicked challenge. It will be good to see the entries.

-shiftLynx
Logged

img]http://www.cdsoft.co.uk/misc/shiftlynx.png[/img]
xteraco
Ancient QBer
****
Posts: 450



WWW
« Reply #7 on: March 27, 2005, 12:12:14 AM »

yep, shiftlynx has it, its like a tunnel effect, i'm just used to calling it a wormhole
Logged

url=http://www.random-seed.net][/url]
Mitth'raw'nuruodo
Ancient Guru
****
Posts: 515



WWW
« Reply #8 on: March 27, 2005, 12:15:14 AM »

I know I said I wouldn't post here, but I think other people might need some clarification:

So you want me to make it look like your looking down a long tunnel? Any animation? If so a spinning tunnel? A plasma-looking tunnel? :-?
Logged

i]"But...it was so beautifully done"[/i]
xteraco
Ancient QBer
****
Posts: 450



WWW
« Reply #9 on: March 27, 2005, 01:41:07 AM »

well, animations are nice, weather its a plasma tunnel or whatnot is a matter of preference.. the style of your animated tunnel is part of what makes this a comptetition, your tunnel will be judged partly on looks, partly on code size, and lastly, partly on how well commented your code is.. my idea was to make a competition that everybody could learn from Cheesy
Logged

url=http://www.random-seed.net][/url]
Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« Reply #10 on: March 27, 2005, 11:35:50 AM »

Smiley Worm hole, under 32, says 32, but you asked for comments, that added to the lines... This is in FreeBasic, hits 6600 FPS on mine, if it goes to fast for you to see it, you might need a minor delay... :wink: But, since it spirals, if it goes faster, it might just look better... Cheesy

Code:
'Set screen mode to 800*600 RGB
SCREEN 19, 32, 2, 1
'Set the center of the screen..
cntx = 400
cnty = 300
'Set are camera lens..
LENS = 256
'Start timer for frames per second
T! = TIMER
'Main LOOP
DO
   r = 40' Radius of worm hole
   z = z + 1 'Z cord of worm hole
   Rang! = ang * 3.14/180 'Degrees to Radians
   x! = r * COS(Rang!) 'Polar to Cartesain X
   y! = r * SIN(Rang!) 'Polar to Cartesain Y
   Dist = LENZ - z ' Find distance
   IF z > 256 THEN ' Check for max Z,..
      z = 0 'If true, reduce back to 0
   END IF 'End code block
   IF z > 0 AND z < 256 THEN 'Make sure z is still on screen
      nx! = cntx + (LENS * x! / Dist)'Find new X
      ny! = cnty - (LENS * y! / Dist)'Find new Y
   ELSE 'So we don't divide by 0
END IF 'End code block
PSET (nx!, ny!), RGB(0, 0, z) 'Place blue pixel
PSET (nx! + 1, ny! - 1), RGB(0, z, 0) 'Place green pixel
ang = (ang + 1) MOD 360 'Add angle, MOD keeps it from going over 360
F = F + 1 'Frame counter
LOOP UNTIL INKEY$ = CHR$(27)' LOOP until Esc is pressed
PRINT "Average FPS:"; F / (TIMER - T!)' Frames per second equation.
SLEEP 'Wait until key is pressed..
Logged

Kevin (x.t.r.GRAPHICS)

xteraco
Ancient QBer
****
Posts: 450



WWW
« Reply #11 on: March 27, 2005, 12:23:10 PM »

comments arent counted as lines of code in this compo, only functional code is counted Cheesy  :wink:
Logged

url=http://www.random-seed.net][/url]
xteraco
Ancient QBer
****
Posts: 450



WWW
« Reply #12 on: March 27, 2005, 12:25:11 PM »

WOW! thats a good entry!!! good work man :bounce:  it looks great!
Logged

url=http://www.random-seed.net][/url]
urger
Wandering Guru
***
Posts: 337



« Reply #13 on: March 27, 2005, 01:26:43 PM »

Do you mean like the Stargate's "Wush" effect?
Logged

his sig left intentionally blank
Mitth'raw'nuruodo
Ancient Guru
****
Posts: 515



WWW
« Reply #14 on: March 27, 2005, 01:58:54 PM »

You mean when the event horizon burst out while intializing a stable wormhole?  
Ummm...Also that thing that you want to be out of the way of unless you want to become a smoking pair of shoes?

:shifty: Ummm...don't ask. Cheesy  That all was a joke above. :lol: LAUGH! Shocked

Ya you try that and make it your entry, it will look cool but its not the thing I think that he wants.
Logged

i]"But...it was so beautifully done"[/i]
Pages: [1] 2 3 ... 6
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!