Erakis

06-10-2002, 09:04 AM

Hello.

I'm building a camera Class. There, is the private members of the class :

//Camera matrix

MATRIX4 CamMatrix;

// Each axis of the camera

VECTOR3D CamAxisX;

VECTOR3D CamAxisY

VECTOR3D CamAxisZ

// Direction vector

VECTOR3D CamView;

//Position of the camera

VECTTOR3D CamPos

So now I will explain what is my problem.

I want to use my own matrix operation, so I don't want to use glRotated or glTranslated.

I just need to use a GL command when it time to update the camera so

glLoadMatrix( CamMatrix )

Well, now I have no difficulty with translation along an axis. So I can go UP and DOWN, Straf LEFT to RIGHT or move FORWARD and BACKWARD.

The problem is starting with rotation

I built a function like this one :

Camera::Pitch( float Angle )

{

// Where Angle could be 15°. So add 15°

// to the camera direction (Ex :Look Up)

// I have/want to update the matrix and the

// others members of the class.

// If axis change I need to update it too.

// I know that I need to apply a rotation

// (pitch) around the X axis but how ?

// What I need ? Help please http://www.opengl.org/discussion_boards/ubb/frown.gif

}

A big Thanks

Martin

[This message has been edited by Erakis (edited 06-10-2002).]

I'm building a camera Class. There, is the private members of the class :

//Camera matrix

MATRIX4 CamMatrix;

// Each axis of the camera

VECTOR3D CamAxisX;

VECTOR3D CamAxisY

VECTOR3D CamAxisZ

// Direction vector

VECTOR3D CamView;

//Position of the camera

VECTTOR3D CamPos

So now I will explain what is my problem.

I want to use my own matrix operation, so I don't want to use glRotated or glTranslated.

I just need to use a GL command when it time to update the camera so

glLoadMatrix( CamMatrix )

Well, now I have no difficulty with translation along an axis. So I can go UP and DOWN, Straf LEFT to RIGHT or move FORWARD and BACKWARD.

The problem is starting with rotation

I built a function like this one :

Camera::Pitch( float Angle )

{

// Where Angle could be 15°. So add 15°

// to the camera direction (Ex :Look Up)

// I have/want to update the matrix and the

// others members of the class.

// If axis change I need to update it too.

// I know that I need to apply a rotation

// (pitch) around the X axis but how ?

// What I need ? Help please http://www.opengl.org/discussion_boards/ubb/frown.gif

}

A big Thanks

Martin

[This message has been edited by Erakis (edited 06-10-2002).]