animating movement

How does one animate movement between coords.

like this:
(only xy coords for simplicity)
Between 0.0,0.0 and 3.0,5.0 and then from there to 6.0,-2.0

PS. i AM incredibly clueless, so try to keep it simple :slight_smile: DS.

I am not sure of the question, but perhaps a loop?!

I was thinking more in the ways of moving something along a β€˜path’ but i dont know if this is possible.

If I get you right, you want to specify controlpoints along your path?

Then you can make a structure for each controlpoint, and it can look something like this:

struct controlpoint
{
float point[3]; // controlpoint coordinates
float rotation[3]; // the rotation for each controlpoint
… and so on
}

You also need a timevariable called t for example. To determine between what controlpoints you are, just use a=floor(t), and you know you are between point a and a+1. Then you just interpolate between those two points using t-a as interpolation factor

You can also use some other obscure methods to smoothly interpolate between two points, like Bezier and NURBS, cosine- and cubic interpolation.

If you are using a the above structure with all kind of information you want, you can animate a camera (for example), specifying camerapoint, camera targetpoint, upvector, fov and whatever you like, for each controlpoint. And using a real time variable, the camera will move from on point to another in the same time independant of your framerate.

Here are some places you can look at. http://www.flipcode.com/tpractice/issue03.shtml http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

Bob, you just made my heroes list :slight_smile:

Thank you !!!