PDA

View Full Version : gluLooakAt....



LordOfTheUniverse
12-16-2002, 02:22 AM
Hi,
I hace two matrices - normal and inverted for each
object in scene.
suppose I have camera attached to an object.
How to make camera reflect objects rotations.
Currently I do it like that:
gluLookAt(matrix[12] +distance,matrix[13],matrix[14]
matrix[12], matrix[13], matrix[14]
matrix[4], matrix[5], matrix[6]);
but it works only for rotation around X axis
Please give me a hint.
.

M/\dm/\n
12-16-2002, 04:24 AM
If I got it right (you want to add some sort of 3rd person camera) then all you need is glLoadIdentity(); before drawing the model + some stuff to remove feeling that everything rotates about cameras axis.

LordOfTheUniverse
12-16-2002, 05:39 AM
No, I want to add 1st person camera to an airplane.
The idea I've found, but not yet implemented relating to spherical coordinations of a point seems not very elegant.