ae97004

09-04-2002, 11:58 AM

Hi,

This is a piece of code i wrote.

The aim is to apply difft rotation matrices to the modelview matrix for the normals and the points.

glMatrixMode(GL_MODELVIEW);

glMultMatrixf(TranslationMatrix);

glMultMatrix(ScalingMatrix);

glBegin()

for(i=1;i<=NumberofTriangles;i++)

{

glPushMatrix();

glMultMatrixf(TransposeRotationMatrix);

//Set the normal

glPopMatrix();

glMultMatrixf(RotationMatrix);

//plot the verices

}

glEnd();

Error: If i gave the glMultMatrix outside the glBegin() End() loop then using only one rotation matrix iam able to get it to work, but if i give it as such inside with two difft matrices for normals and rotation i can only get the object to translate and scale but iam not able to get it to rotate at all.

Any comments to fix this, or another alternative method would be greatly appreciated.

Thanks

Prashanth

This is a piece of code i wrote.

The aim is to apply difft rotation matrices to the modelview matrix for the normals and the points.

glMatrixMode(GL_MODELVIEW);

glMultMatrixf(TranslationMatrix);

glMultMatrix(ScalingMatrix);

glBegin()

for(i=1;i<=NumberofTriangles;i++)

{

glPushMatrix();

glMultMatrixf(TransposeRotationMatrix);

//Set the normal

glPopMatrix();

glMultMatrixf(RotationMatrix);

//plot the verices

}

glEnd();

Error: If i gave the glMultMatrix outside the glBegin() End() loop then using only one rotation matrix iam able to get it to work, but if i give it as such inside with two difft matrices for normals and rotation i can only get the object to translate and scale but iam not able to get it to rotate at all.

Any comments to fix this, or another alternative method would be greatly appreciated.

Thanks

Prashanth