PDA

View Full Version : Particle system question...

Ace_Man
01-04-2001, 07:16 PM
I've written a particle system which sort of models the NeHe approach. ontrolling the movement of my particles is fairly simple if I want predictable movement. Example: all particles move up/left/right/ forward/backward/ randomly etc...

If I define my particle X and Z values by Sine and Cosine I can form a circle with my particles. My question is the simplest way to move my particles to the origin of the circle they define.

I realize this is more Math oriented but thought I'd ask anyway.

I have one more question. Is it common for your program to slow down if large numbers of objects are "close" to the camera's viewpoint? If I move my camera far away from 1000 moving particles (textured quads) they move smoothly. If I zoom in things slow down terribbly. Is this a common occurance? It just seems odd since it's the same number of polygons being drawn either way (Just on a larger scale).

Thanks again.

zed
01-04-2001, 08:45 PM
1/ didnt really understand the question.
normally with a particle system each particle's position is updated depending on its velocity

first give each particle an initial velocity

then each loop
change velocity here eg add gravity or slow the velocity down etc.
pos += vel;

2/ yes youre card is filling in MUCH more pixels.

j
01-04-2001, 08:52 PM
If I define my particle X and Z values by Sine and Cosine I can form a circle with my particles.

If you do it this way:

x = dist * sin(time);
y = dist * cos(time);

Then dist is the distance from the center of the circle, so a value of 0 would put the particles at 0, 0.

j

Ace_Man
01-04-2001, 09:29 PM
Thanks for the response...
Sorry if I was unclear...I figured it out.

Thanks again