That’s exactly what I’m doing…
Anyhow, I did what you said and as far as the rotation goes it seems to do as intended, first a 90deg yaw gets me from
L=1, 0, 0
U=0, 1, 0
F=0, 0, 1
to
L=0, 0, -1
U=0, 1, 0
F=1, 0, 0
then rotating that vertically gets
L=0, 0, -1
U=1, 0, 0
F=0, -1, 0
So i figure it must be how I’m building the final view matrix and passing it to GL. So here’s that, more or less.
CMatrix CamMatrix(Right.GetX(), Up.GetX(), Forward.GetX(),
Right.GetY(), Up.GetY(), Forward.GetY(),
Right.GetZ(), Up.GetZ(), Forward.GetZ());
CamMatrix.Transpose();
CVector3D Result = CamMatrix.Mul(Position);
Result.Flip();
float Matrix[16];
Matrix[0] = CamMatrix.Get(0, 0);
Matrix[1] = CamMatrix.Get(0, 1);
Matrix[2] = CamMatrix.Get(0, 2);
Matrix[3] = Result.GetX();
Matrix[4] = CamMatrix.Get(1, 0);
Matrix[5] = CamMatrix.Get(1, 1);
Matrix[6] = CamMatrix.Get(1, 2);
Matrix[7] = Result.GetY();
Matrix[8] = CamMatrix.Get(2, 0);
Matrix[9] = CamMatrix.Get(2, 1);
Matrix[10] = CamMatrix.Get(2, 2);
Matrix[11] = Result.GetZ();
Matrix[12] = 0;
Matrix[13] = 0;
Matrix[14] = 0;
Matrix[15] = 1;
glLoadMatrixf(Matrix);
//glMultMatrixf(Matrix);
I’ve tried loading the matrix directly, and loading the identity, then multiplying by that before drawing, doesn’t make a diff naturally.
[This message has been edited by outRider (edited 02-07-2002).]
Ignore the fact that one of the vectors is named Right and that I keep reffering to it as left, it should be Left but its 6am…
If anyone wants to see what I see http://www.geocities.com/y_mohamoud has the basic exe, texture, and camera source. If you run that and hit left the cam rotates left, so rotate 90 to the left, then hit up, you’ll see what I mean.
I appreciate the help Gorg, and anyone else who has time to kill.
[This message has been edited by outRider (edited 02-07-2002).]
[This message has been edited by outRider (edited 02-07-2002).]