Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Particle, Problem Implimenting Gravity/Wind
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Kuntzy




PostPosted: 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?



gravity_particle.t
 Description:
Here it is:

Download
 Filename:  gravity_particle.t
 Filesize:  2.61 KB
 Downloaded:  141 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Jan 19, 2004 10:45 pm   Post subject: (No 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
AsianSensation




PostPosted: Mon Jan 19, 2004 10:49 pm   Post subject: (No 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: