TheBlackAdder

10-18-2005, 05:10 AM

Hello, I need to rotate an object 90 degrees around the X-axis.

Since I am very new to OpenGL I am still practicing, and therefor i don't want to use the glRotate function in this program I am doing at the moment.

So I want to specify the Rotation matrix myself and then add it using glMultMatrix.

I did the following:

//The rotation matrix OGL style:

GLfloat R[16]={1,0,0,0,cos(90),sin(90),0,0,-sin(90),cos(90),0,0,0,0,1}

//In the display func:

glPushMatrix();

glMultMatrix(R);

drawhouse();//this is the object i am rotating

glPopMatrix();

There is some rotation going on, but it is wrongly rotated. I cannot understand what I am doing wrong.

I hope somebody can help me out here, thank you very much.

Many regards the Black Adder

Since I am very new to OpenGL I am still practicing, and therefor i don't want to use the glRotate function in this program I am doing at the moment.

So I want to specify the Rotation matrix myself and then add it using glMultMatrix.

I did the following:

//The rotation matrix OGL style:

GLfloat R[16]={1,0,0,0,cos(90),sin(90),0,0,-sin(90),cos(90),0,0,0,0,1}

//In the display func:

glPushMatrix();

glMultMatrix(R);

drawhouse();//this is the object i am rotating

glPopMatrix();

There is some rotation going on, but it is wrongly rotated. I cannot understand what I am doing wrong.

I hope somebody can help me out here, thank you very much.

Many regards the Black Adder