Author Topic: Short Intro Challenge - 3d rubber, 3d starfield and 3d bobs in 20  (Read 6809 times)

0 Members and 1 Guest are viewing this topic.

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Updated and Optimized.....

New update: More stars and more bob helix

Code: [Select]
'Here's my final entry to the 20 line screen effect challenge in DBF
'Features
'1. scaled and multi colored 3d Starfield
'2. 3d rubber band effect
'3. scaled and multicolored 3d bobs
'Relsoft 2006
'http://rel.betterwebber.com
'updated!!!!


1     IF F& = 0 THEN SCREEN 18,32 , 2,1 ELSE if F% = 1 then screenset 1,0 else LINE (0, 0)-(639, 479), 0, BF
2     F& = (F& + 1) AND &H7FFFFFFF
3     FOR i% = 0 TO 300
4     if i% < 300 then A! = (A! + 0.0003) * -(A! < 6.283186 - 0.0003) else screensync
5     IF F& = 1 THEN DIM S!(300, 3) ELSE IF F& = 2 THEN S!(i%, 0) = -90 + INT(RND * 180) ELSE IF F& = 3 THEN S!(i%, 1) = -80 + INT(RND * 160)
6     IF F& > 3 THEN S!(i%, 2) = (S!(i%, 2) + S!(i%, 3)) * -(S!(i%, 2) < 253) ELSE S!(i%, 2) = INT(RND * 255)
7     IF F& > 3 THEN CIRCLE ((320 + (256 * S!(i%, 0) \ (256 - S!(i%, 2)))), (240 - (256 * S!(i%, 1) \ (256 - S!(i%, 2))))), 128 \ (256 - S!(i%, 2)), rgb(s!(i%, 0)*s!(i%, 1),s!(i%, 2),s!(i%, 3)) ELSE S!(i%, 3) = .1 + RND * 2
8     x! = ((250 * COS(4 * 3.141593 / 200 * I%)) * (COS(A!) * COS(A!)) + (250 * SIN(8 * 3.141593 / 200 * I%)) * (SIN(A!) * SIN(A!) * COS(A!) - COS(A!) * SIN(A!)) + (I% - (200 / 2)) * (COS(A!) * SIN(A!) * COS(A!) + SIN(A!) * SIN(A!)))
9     y! = ((-150 * COS(8 * 3.141593 / 200 * I%)) * (COS(A!) * SIN(A!)) + (150 * SIN(8 * 3.141593 / 200 * I%)) * (COS(A!) * COS(A!) + SIN(A!) * SIN(A!) * SIN(A!)) + (I% - (200 / 2)) * (-SIN(A!) * COS(A!) + COS(A!) * SIN(A!) * SIN(A!)))
10    z! = ((50 * COS(16 * 3.141593 / 200 * I%)) * (-SIN(A!)) + (50 * SIN(8 * 3.141593 / 200 * I%)) * (SIN(A!) * COS(A!)) + (I% - (200 / 2)) * COS(A!) * COS(A!))
11    if i% < 300 then circle((320 + (256 * x! \ (256 - z!))), (240 - (256 * y! \ (256 - z!)))), 1024 \ (256 - z!), rgb((A! * 57.29577 + I%),(A! + I%),(A!* I%)) else y! = -320       
12    NEXT i%
13    twister! = 0   
14    for Slice = 0 TO 640
15        if slice <640 then twister! += csng(sin(F&/18) *0.0129171) else screencopy
16        y! += 1
17    for Band = 0 TO 3             
18        line -(320 + (256 * (70+(sin((F&+slice)/42) * 15)) * cos((6.28 / 4) * Band+twister!) / (256 - z!*0.7)), 240 - (256 * y! / (256 - (70+(sin((f&+slice)/42) * 15)) * sin((6.28 / 4) * Band+twister!)))), rgb(slice * 10, band * 20 ,slice * band), , &haaefa911 
19    next Band, Slice
20    IF INKEY$ = "" THEN 1

Code: [Select]
'Here's my final entry to the 20 line screen effect challenge in DBF
'Features
'1. scaled and multi colored 3d Starfield
'2. 3d rubber band effect
'3. scaled and multicolored 3d bobs
'Relsoft 2006
'http://rel.betterwebber.com

1Â  Â  Â IF F& = 0 THEN SCREEN 18,32 , 2,1 ELSE if F% = 1 then screenset 1,0 else LINE (0, 0)-(639, 479), 0, BF
2Â  Â  Â F& = (F& + 1) AND &H7FFFFFFF
3Â  Â  Â FOR i% = 0 TO 200
4Â  Â  Â if i% < 200 then A! = (A! + .0003) * -(A! < 6.283186 - .0003) else screensync
5Â  Â  Â IF F& = 1 THEN DIM S!(200, 3) ELSE IF F& = 2 THEN S!(i%, 0) = -90 + INT(RND * 180) ELSE IF F& = 3 THEN S!(i%, 1) = -80 + INT(RND * 160)
6Â  Â  Â IF F& > 3 THEN S!(i%, 2) = (S!(i%, 2) + S!(i%, 3)) * -(S!(i%, 2) < 253) ELSE S!(i%, 2) = INT(RND * 255)
7Â  Â  Â IF F& > 3 THEN CIRCLE ((320 + (256 * S!(i%, 0) \ (256 - S!(i%, 2)))), (240 - (256 * S!(i%, 1) \ (256 - S!(i%, 2))))), 128 \ (256 - S!(i%, 2)), rgb(s!(i%, 0)*s!(i%, 1),s!(i%, 2),s!(i%, 3)) ELSE S!(i%, 3) = .1 + RND * 2
8Â  Â  Â x! = ((250 * COS(4 * 3.141593 / 200 * I%)) * (COS(A!) * COS(A!)) + (50 * SIN(8 * 3.141593 / 200 * I%)) * (SIN(A!) * SIN(A!) * COS(A!) - COS(A!) * SIN(A!)) + (I% - (200 / 2)) * (COS(A!) * SIN(A!) * COS(A!) + SIN(A!) * SIN(A!)))
9Â  Â  Â y! = ((150 * COS(8 * 3.141593 / 200 * I%)) * (COS(A!) * SIN(A!)) + (50 * SIN(8 * 3.141593 / 200 * I%)) * (COS(A!) * COS(A!) + SIN(A!) * SIN(A!) * SIN(A!)) + (I% - (200 / 2)) * (-SIN(A!) * COS(A!) + COS(A!) * SIN(A!) * SIN(A!)))
10Â  Â  z! = ((50 * COS(8 * 3.141593 / 200 * I%)) * (-SIN(A!)) + (50 * SIN(8 * 3.141593 / 200 * I%)) * (SIN(A!) * COS(A!)) + (I% - (200 / 2)) * COS(A!) * COS(A!))
11Â  Â  if i% < 200 then CIRCLE ((320 + (256 * x! \ (256 - z!))), (240 - (256 * y! \ (256 - z!)))), 1024 \ (256 - z!), rgb((A! * 57.29577 + I%),(A! + I%),(A!* I%)) else y! = -320Â  Â  Â  Â  
12Â  Â  NEXT i%
13Â  Â  twister! = 0Â  Â  
14Â  Â  for Slice = 0 TO 640
15Â  Â  Â  Â  twister! += csng(sin(F&/18) *0.0129171)
16Â  Â  Â  Â  y! += 1
17Â  Â  for Band = 0 TO 3Â  Â  Â  Â  Â  Â  Â  
18Â  Â  Â  Â  if slice <640 then line -(320 + (256 * (70+(sin((F&+slice)/42) * 15)) * cos((6.28 / 4) * Band+twister!) / (256 - z!)), 240 - (256 * y! / (256 - (70+(sin((f&+slice)/42) * 15)) * sin((6.28 / 4) * Band+twister!)))), rgb(slice * 10, band * 20 ,slice * band), , &haaefa911Â  else screencopy
19Â  Â  next Band, Slice
20Â  Â  IF INKEY$ = "" THEN 1


exe ans source attatched. :*)
« Last Edit: June 21, 2006 by relsoft »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17378
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Crumbs! That's a lot of effects to be squeezed into 20 lines!
Staggering.
Nice twister too :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Got bored after finishing my tute for QBE.  Last entry for me though.  Doing some newton lib learning.  For the KART game. :*)

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17378
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
I'd been wondering where you were Rel :)
Voting starts on Saturday btw.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Went to the boondocks, did some farming.

Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Nice one relsoft, it has a ZX Spectrum feel to it.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Optimus

  • DBF Aficionado
  • ******
  • Posts: 2452
  • Karma: 128
    • View Profile
    • Optimouse Demo Site
Cool!

I have few days to work on my second entry now ;)
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Updated. See first post.  O0
Challenge Trophies Won:

Offline cirux

  • Atari ST
  • ***
  • Posts: 129
  • Karma: 4
    • View Profile
Thats insane, how do you fit soo much into so little space. Great work!

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Thanks.  I've had..."practice"
 O0
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17378
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Updated and optimised?!? It was fast as it was! :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
the update has screensync and put the screenflip check on the outside loop. :*)
Challenge Trophies Won:

Offline Tetra

  • DBF Aficionado
  • ******
  • Posts: 2532
  • Karma: 83
  • Pirate Monkey!
    • View Profile
Very Cool Relsoft  ;D

Really like the twisty rubber band ting :)
Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Impressive as hell in 20 lines! Good one relsoft: ++ karma I think for that!
Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Love the colors. My 2 favorite! Very nice.  I agree I like the rubber band thingy.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Wow! It's so vibrant and lively.
You are our 9001st visitor.
Challenge Trophies Won: