   particles break apat, going up then down then bounces on the ground.., how?
  hiya,i know how to make it go up, then i make it go down by subtracting it''s velocity with gravity * elapsed time;then i checked if(particle pos < 0.0f)// what do i do here? how would i make it slowly bounce till it stops?many thanks,  
    I would think that after it hits the ground its velocity would be reversed and slowed down somewhat till it finally reaches zero.  ;  Since you should know the speed of the particle as it passes the ground, I would just revers the direction, and cut the speed in half.  Thus each time it bounces it will only bounce half as high.  When the speed gets low enough that it doesn''t appear to the eye that it bounces, I would either delete it, or set it''s velocity to zero.  Depending on if you want it to stay there on the ground or not.  ;  wow, thanks it works off topic... in physics, what does this thing resolve too?velocity += accelaration * elpasedtimeposition += velocity * elpasedtime;i mean, why are movement done like those?thanks,;  By definition, its:v = a * ts = v * twherev is speeda is accellerations is positiont is timeThis is the reason why speed is measured in meters per second, or miles per hour if you like that better (s = v * t => v = s / t).When you do step-wise simulation, it comes to the following formulae:v(t + delta_t) = v (t) + a(t) * delta_ts(t + delta_t) = s (t) + v(t) * delta_twheredelta_t is elapsed timeand v(t) meaning speed at time tif you break it down to C code, it yields your formulae.The simplification done here, of course, is that accelerationis considered constant during the period delta_t.Hope that helps.Tilmann;quote:Original post by mickey  wow, thanks it works off topic... in physics, what does this thing resolve too?velocity += accelaration * elpasedtimeposition += velocity * elpasedtime;i mean, why are movement done like those?thanks,  It boils down to a bit of calculus. Lets simplify your symbols. Let a = acceleration, v = velocity, s = position, t = time. (s is sort of a traditional symbol for distance.)acceleration, by definition   is equal to:a = dv/dt  That d*/d* notation represents a "derivative" which is basically the slope of a curve. acceleration is the slope of the velocity curve. Now, using what is called finite differences, you can approximate   the value of dv/dt by the following formula:dv/dt = (approx.) (v(t + ellapsedtime) - v(t)) / ellapsedtime  That v(t + ellapsedtime) is just exactly what you''re calculating when you do velocity += acceleration*ellapsed time. That is, rearrangging my equation, you get:v(t+ellapsedtime) = (dv/dt)*ellapsedtime + v(t)which, since dv/dt = a, is exactly:v(t+ellapsedtime) = a*ellapsedtime + v(t)  Now, you never keep track of the value of v at different times. You just use one variable, velocity, but in effect when you update velocity you are taking the current velocity and adding a*ellapsedtime to get the new velocity.Position is the same. By definition, using calculus, v = ds/dt, which using finite differences is approximated as:ds/dt = (approx.) (s(t+ellapsedtime) - s(t))/ellapsedtime  Now the particular approximations to ds/dt and dv/dt used above lead to what is known as "simple Euler integration" or "explicit Euler integration." Integration, or numerical integration, is the process of updating a variable based on a previous time step. The simple Euler integration method is one of the simplest, and also one of the most problematic. It can lead to instability, e.g., overflow, etc., in some cases. As you continue to learn how to do physics simulation, you''ll learn about things like "Runge Kutta," "verlet," "predictor-corrector," and other types of integration. Its usually easiest to implement an algorithm using Euler, but often it is necessary to user another method, very often verlet or Runge-Kutta, to resolve problems. These other methods are also based on finite differences. Finite differences, in turn, are based on the use of the Taylor series expansion----a core theorem of basic calculus.    Graham RhodesSenior ScientistApplied Research Associates, Inc.  ;  I suppose that''s a good example of Calculus in a nutshell ;  wow thanks, well, as of now, i won''t be able to 100% appreciate what you guys just explained to me, but maybe after a few more readings later, i would then clearly understand what you guys just told me now. but still thanks very much for these explainations, ;quote:Original post by sgt_barnes  By definition, its:v = a * ts = v * t  Just to be sure you''re straight on this....these formulas are not   definitions. They''re really just approximate formulas that are derived from the finite difference approximation to dv/dt and ds/dt as I describe in my other post. . And t isn''t absolute time. It is the elapsed time since a, v, and s were last evaluated.    Graham RhodesSenior ScientistApplied Research Associates, Inc.  