[gameprogrammer] Re: particle system in DirectX

hey dude, you didnt ask a specific question so i'll start from the
beginning as i see it (other more experienced people may jump in and
correct me but here you go)

particle systems are made up of particles (hehe) and particles can be
drawn either as images or by colored pixels.

You store your particles in some kind of repository (array, linked
list, something like that) and draw them every frame as well as
preform some logic on them based on what type of particle it is
(gravity and movement calculations for water vs a floating and dimming
effect for ffire and smoke).

If you are doing 2d graphics, you just of course draw the image to the
screen but if you are doing 3d graphics, you will probably want to
draw your particles billboard style so they are always facing the
player's viewpoint directly.

For your spring here's kind of how i would do it (asuming it's in 3d)

every particle has these variables:
float Position[3];     //X,Y,Z position of particle
float Momenum[3];  //momentum in X,Y,Z axis of the particle

then every frame you would do this for each particle:

1) Change Y momentum based on a gravity equation
2) add momentum to position for all 3 axis'
3) draw the particle to the screen

Does that make sense?

On 2/8/07, Husam Zakaria <hzcppff@xxxxxxxxx> wrote:
Hi, every one, I need to create a particle system indicate a water spring
from a given point in space

the water will spring from that point to up direction then it will drop to
the floor, any one can help me
in this ?



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: