Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

a particle engine how to make one and eny math algos

This topic is 6604 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

particle systems are a doddle... create a type with these properties.. (not vb code)

inuse as boolean
x as integer
y as integer
xv as integer
yv as integer
c as color

then create an array of them like this:

dim parts(1000) as part_type;


then to create a particle:

for a=0 to 1000
if parts(a).inuse = false then goto got_one
next a
' Couldn't find a free one!
got_one:
' for each property
parts(a).property = value


then to update & draw the parts, just use

for a=0 to 1000
if parts(a).inuse = true then
' draw at x,y in color c
plot(x,y,c)

' update pos according to velocity
parts(a).x = parts(a).x + parts(a).xv
parts(a).y= parts(a).y + parts(a).yv
end if
next a


this is fine for simple systems, anyway. i've made tons of progs using particle systems in qbasic - if you want the code, ask...

Share this post


Link to post
Share on other sites
A particle system, as said, is not particularly interesting or complicated - rendering it efficiently and getting the right behaviour of the particles, however, is probably more black magic than science.

Some of the things you might want to consider are basic physical properties such as speed, mass, elasticity and acceleration. Don't expect a physically correct 10000 particle system to run anyway near 50fps though - especially not when written in Visual Basic.

/Niels

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
kieren_j:

how would i make an animation that would show the velocity changes of the particles?
How would i make an animation using the pset command, i know many dont like this command but i need somewere to start. if you could other examples would also be helpfull.
could you send me those examples

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
hello

im trying to make a particle engine, how would i do one in vb? Also looking for math algos to set the physics and path of them in any langage thanks

Share this post


Link to post
Share on other sites