Computer Science Canada

Particle, Problem Implimenting Gravity/Wind

Author:  Kuntzy [ Mon Jan 19, 2004 10:39 pm ]
Post subject:  Particle, Problem Implimenting Gravity/Wind

This is just a basic paricle engine, The controls are move the mouse and click down to start the wind. The velocity and angle of the wind will be determined by the postion of the mouse.

The problem is that when I put in a large number of particles, or the velocity of the x or y is fairly large, you cane see a distinct square grid/pattern. Does anyone know where the problem is?

Author:  Tony [ Mon Jan 19, 2004 10:45 pm ]
Post subject: 

the problem is that you move particles by pixels... so when the "wind" causes particles to move at the rate of 5 pixels per frame, they "jump" that distance...

what you need to do is to keep movement to a 1pixel/frame max. That would result in subpixel movement per frame, so you'd have to round to render your particle system

Author:  AsianSensation [ Mon Jan 19, 2004 10:49 pm ]
Post subject: 

i'm thinking that it's your wind velocity. you move the particles by that much each time, and wind velocity is a set value. Maybe if you have smaller wind velocity or something, or make it real numbers and round later, i don't know, something like that.

Edit: damn tony, beat me to it, oh well, at least I will be the first to award the guys some bits, here Kuntzy, have 30 bits


: