PDA

View Full Version : Camera issues



LordOfTheUniverse
12-19-2002, 12:54 PM
How to make camera reflect changes
in my object's orientation.

I have matrix attached to my object,
which i use to feed glMultMatrix().

I want camera to roll/pitch/yaw/move as my object does.

Relic
12-20-2002, 02:23 AM
There's no "camera" in OpenGL.
Apply the inverse rotation to the rest of the world (at the top of the transformation hierarchie).
This will give a first person shooter or flight sim look.

[This message has been edited by Relic (edited 12-20-2002).]

LordOfTheUniverse
12-20-2002, 04:26 AM
Only rotation, or also translation?

When I made it in a way like this:

rotate(XYZ) > modelMatrix;
translate > modelMatrix;

transpose(modelMatrix) > InvmodelMatrix

and when drawing:

glLoadIdentity();

glMultMatrix(InvModelMatrix);
gluLookAt(distance, 0,0,
0, 0, 0,
0, 1, 0);

scene....

glPushMatrix()
glMultMatrix(modelMatrix);
glPopMatrix();

I received only a small stripe of scene across window,
everything else was black;