Posted: 17th Jan 2004 17:49
Coded in 1 hour, here's a fast (1000 spheres = 60fps here) snow effect, just run it

+ Code Snippet
sync rate 0
sync on
hide mouse

rem Amount = amount of snow particles, 1000 = 60FPS on my machine :)
amount = 1000

rem Speed = How fast should the particles move? keep this between 0.1 and 3 for the best result
speed# = 0.1

rem Lets make the 3d world
make object plain 2,5000,5000
color object 2,rgb(200,200,255)
position object 2,0,0,0
xrotate object 2,90

make object cube 1,20
color object 1,rgb(255,128,0)

position object 1,20,0,20

rem Particles
for a=1000 to 1000+amount
 snow_particle_init(a,1)
 position object a,0,rnd(300),0
next a

rem The main loop

do

 for a=1000 to 1000+amount
  snow_particle(a,speed#)
 next a

if upkey()=1 then move object 1,1
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-1)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+1)

position object 1,object position x(1),10,object position z(1)

position camera object position x(1)+(sin(object angle y(1)+180)*50),20,object position z(1)+(cos(object angle y(1)+180)*50)
point camera object position x(1),object position y(1),object position z(1)

text 5,10,"Amount of snow particles: "+str$(amount)
text 5,25,"FPS: "+str$(screen fps())
sync

loop

rem Functions
function snow_particle_init(number,image)
   make object sphere number,rnd(1)+1
   set object number,1,0,0,1
   color object number,rgb(255,255,255)
endfunction

function snow_particle(number,speed#)

   height# = object position y(number) - speed#

      if height# < -5 then height# = 300

      position object number,object position x(1)+(sin(number)*100),height#,object position z(1)+(cos(number)*100)

      rotate object number,object angle x(number),object angle y(number),wrapvalue(object angle z(number)+1)

endfunction
Posted: 17th Jan 2004 20:13
It isn't doing anything on my computer when I run it.
Posted: 17th Jan 2004 20:40
Must be your computer
Posted: 17th Jan 2004 22:16
It's cool,but it load too slow.
Posted: 17th Jan 2004 22:21
try doing it with plains, textured with snow flake images, that rotate in a random kinda way, it would look better+be quicker too
Posted: 18th Jan 2004 16:55
I got it to work now. It is just a bit slow, though.
Posted: 18th Jan 2004 18:29
Change the amount (1000) to 360
Posted: 21st Jan 2004 5:17
Using spheres for particules is absolutely insane

Always use plains for particles. A 10x10 texture will give them a decent snow appearance.
Posted: 21st Jan 2004 5:38
Here's a (pro native) example

It gets weird with heavy Y movement. The main difference from your code is that you can turn the particles up to 10,000 and still get higher frame rates than you would using default spheres!
Posted: 21st Jan 2004 18:09
and its not all there in the source!