Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Rem Project: test
- Rem Created: 5/2/2010 5:08:38 AM
- reboot:
- ticks = 0` it may overflow AND shit :P
- offsx=offsx+RND(15):IF offsx > 630 THEN offsy=offsy+35:offsx=0
- IF offsy>480 THEN offsx=0:offsy=0
- SET GLOBAL OBJECT CREATION 1
- Rem ***** Main Source File *****
- global DIM seedx#(32768) ` Seed X
- global DIM seedy#(32768) ` Seed Y
- global DIM seedz#(32768) ` Seed Z
- global DIM seeda#(32768) ` Seed Angle
- global DIM seedd#(32768) ` Seed Depth
- global DIM seedb#(32768) ` Seed Breed
- global DIM seedl#(32768) ` Seed Life
- global seednum AS INTEGER = 1
- global rcolor =128
- global gcolor =128
- global bcolor =128
- global offsetx
- global offsety
- global grow_distance# = 0.75
- global cx AS INTEGER = 0
- global obj AS INTEGER = 1
- global count AS INTEGER = 24
- global ticks AS INTEGER = 0
- global siz# AS float
- seedx#(0) = 0 ` Initial Seed X
- seedy#(0) = -50 ` Initial Seed Y
- seedz#(0) = 0 ` Initial Seed Z
- seeda#(0) = RND(10)+85 ` Initial Seed Angle
- seedd#(0) = 0 ` Initial Seed Depth
- seedb#(0) = 20 ` Initial Seed Breed
- seedl#(0) = 100 ` Initial Seed Life
- `make camera 1
- `position camera 0,0,-100
- `backdrop ON
- `color backdrop 1,rgb(0,0,0)
- `make light 1
- `position light 1,-40,0,0
- `color light 1,rgb(128,0,255)
- rcolor = RND(255)
- bcolor = RND(128)+128
- gcolor = RND(30)
- offsetx= offsx+RND(15)
- offsety= offsy+RND(15)
- DO
- ` process each seed
- loopseednum = seednum-1
- FOR n = 0 TO loopseednum
- seedl#(n) = seedl#(n) - 1
- IF seedl#(n) > 0
- ` Grow up
- seedx#(n) = seedx#(n) + COS(seeda#(n)) * grow_distance#
- seedy#(n) = seedy#(n) + SIN(seeda#(n)) * grow_distance#
- seedz#(n) = seedz#(n) + seedd#(n) * grow_distance#
- grow_at(seedx#(n), seedy#(n), seedz#(n), seedl#(n))
- ` Breed new child
- IF seedb#(n) <= 0
- ` Angle AND depth TO spread
- angle# = 15 + RND(15)
- IF RND(1) = 1 THEN angle# = -angle#
- depth# = ( -10 + RND(20) ) / 10.0
- seedx#(seednum) = seedx#(n)
- seedy#(seednum) = seedy#(n)
- seedz#(seednum) = seedz#(n)
- seeda#(seednum) = seeda#(n) - angle#
- seeda#(n) = seeda#(n) + angle#
- seedd#(seednum) = depth#
- seedd#(n) = depth#
- seedb#(seednum) = 8 + RND(8)
- seedl#(seednum) = seedl#(n) + RND(10)
- ` We have a new seed!
- seednum = seednum + 1
- ` RESET breed
- seedb#(n) = 8 + RND(8)
- ELSE
- seedb#(n) = seedb#(n) - 1
- endif
- endif
- NEXT
- tc=tc+5:IF tc>360 THEN tc=0
- FOR n = 1 TO obj-1
- ` Rotate animation
- ` rotate object n, SIN(ticks)*360,SIN(0-ticks)*360,COS(ticks)*360
- `color object n,rgb(SIN(n+tc)*255,SIN(n+(tc+90))*255,COS(tc-n)*255)
- NEXT n
- rem set cursor 0, 0
- rem PRINT "Childs: ", seednum
- rem PRINT "Objects: ", obj
- rem sync
- `set camera fov 1,120
- `position camera 1,SIN(ticks)*5,-40,-50
- `POINT camera 1,0,-40,0
- ticks = ticks + 1
- IF siz# < 0.9 THEN GOTO reboot
- LOOP
- FUNCTION grow_at( x#, y#, z#, life# )
- siz# = 2.0 - obj / 1800.0
- IF siz# > 0.1
- rem make object sphere obj, siz#
- rem SET OBJECT WIREFRAME obj,0
- rem position object obj, x#+(-0.25+RND(50)/100.0), y#+(-0.25+RND(50)/100.0), 80 + z#+(-0.25+RND(50)/100.0)
- ink rgb(rcolor,bcolor,gcolor), rgb(0,0,0)
- dot offsetx-x#,offsety-y#
- cx=cx+1:IF cx=360 THEN cx=0
- obj = obj + 1
- endif
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement