Hi,
I'm a "traditional programmer" who just has started to do some game programming in Java, but I need som advice, I know there is an algorithm for representing a continuous movement of an object, does anybody know about this algorithm? The only thing I really want to do is some cars running forward at a constant speed, I've heard about an algorithm for this
Um Yeah d1 = d2 = d3.
Given what you derscribe what youa re lookign fro is Newton's first law: A body in rectilinear motion remains in rectilinear motion until acted on by an unbalanced force.
Or in other words, once you start moving in a straight lien you KEEP moving in that straight line at the ame speed forever unless another force acts on you.
Now if you are talking about wanting to calculate the real forces in nature, such as friction, thats singificantly more complex to simulate accurately. Most games simply put an arbitrary 'drag' on the car and leave it at that.
BUT all this is somewhat tangential to games because all games are programmed as discrete time simulations, which is to say the motion is calculated a frame a time in frame-time increments.
So if you are moving dX in the X direction per frame and dY in the Y direction perframe then x = x+dX and y =y+dY per frame. Acceleration is aded as an impulse to dX and dY, drag subtracted.