   Move at constant velocity
  I''m trying to move a object to a constant velocity.To do this i havevec.X+= s.physics.direction.X  * velocity * w.time;vec.Y+= s.physics.direction.Y  * velocity * w.time;vec.Z+= s.physics.direction.Z  * velocity * w.time;(For now i don''t have acceleration, etc)My problem is with the *step* of the world.I use w.time (=sdk -elapsedtime-)Between frames the elapsedtime can be variable0.010016920.00980000etc.This affect visually the movement of the object.How do you work with the *step* world?I don''t know much about physics. 
  using newtonian mechanics (his simple equations)...S=U*T+(1/2)*A*T2U is initial velocity... S is displacement from original position... T is elapsed time, A is acceleration. You do this in all 3 directions.V=U+A*TV is velocity... U is initial velocity.. A is acceleration... T is elapsed time. Keep track of the objects location an dvelocity per frame.. then use those two equations to obtain its displacement (which you add to it''s location) and new velocity. A=0 gives the constant velocity case.These are obtained by solving F=MA for displacement/velocity, with constant force). ie a v simple ODE. Hope this helps. ;  Very thanks, i will try to fix my code with your post  ;quote:Original post by dmounty  using newtonian mechanics (his simple equations)...S=U*T+(1/2)*A*T2U is initial velocity... S is displacement from original position... T is elapsed time, A is acceleration. You do this in all 3 directions. I have the same problem as pedorro77. As far as i can understand,S=U*T+(1/2)*A*T2and    vec.X+= s.physics.direction.X * velocity * w.time;done the same result. The velocity is constant => A=0 => S=U*T  (T is elapsed time from original position) For a movment :   vec.X = sum(s.physics.direction.X * velocity * w.time)   = s.physics.direction.X * velocity * sum(w.time)   = U*T  Where the mistake please ?  Can we assume that T != sum(w.time) due to lack of precision ?;  i think the problem is with your equation.  velocity should be a vector scaled to the speed of the object:struct Vector {    float x, y, z;}   then for your motion equations do:pos.x = vel.x * w.time + pos.x;pos.y = vel.y * w.time + pos.y;pos.z = vel.z * w.time + pos.z;of if you've overloaded your operators correctly for Vector:pos = vel * w.time + pos;-me [edited by - Palidine on February 10, 2004 2:04:39 PM]