# moving a camera (quats?)

I know this has probably been discussed before but what the hay

Say I am in the driver seat of a car and I want to move the camera (smoothly) to an overhead view.

Assuming I know the beginning and ending transformations how does one interpolate between the two?

I think I read that quaternions can do this (easily ha, ha ) any help?

a linear interpolation btw your 2 quaternioins will produce a smotther result than simply making a linear interpolation…
the only thing u have to do is to get the formula to transform your quaternion into a matrix
good luck !

You can choose to do spherical linear interpolation, instead of linear interpolation. That was explained in an article by Jeff Lander (I think) of GDMag.
Found on the GDMag archives.

Interpolating the position is easy, just interpolate the x, y, and z values of the position.

It’s interpolating the rotation that might be difficult. The real way is to interpolate each axe vector, but I think you might just be able to rotate your camera down a bit each frame since you just need the camera to move up and look a little down.

If you use a ‘lookat’ function to aim the camera then you only need to interpolate the position. If you want the camera to come up to and off a velocity then the interpolation should be some funtion of time that will give the desired effect. eg:

position = start*(1-f(t)) + end*f(t)

As f(t) goes from 0 to 1 the camera moves from start to end.

You shouldn’t use quarternions for camera interpolation because you can only fix the orientation of the camera through out in certain cases (of which yours is one actually ).

[This message has been edited by foobar (edited 09-02-2000).]