hi,
i’m trying to rotate the arm of my object and then move the whole object forward (along the x axis) but the following code produces some ‘interesting’ results:
Well it depends upon what you are trying to do… I would assume that you want the leg to move, then have he figure move, right? Well, here is what your code is doing right now:
glPushMatrix();
//Begins new matrix in stack
glTranslatef(hipx, shouldery, 0.0);
//translates the drawing position to hipx, shouldery
glRotatef(left_arm_angle, 0.0, 0.0, 1.0);
//Rotates the drawing position
glTranslatef(-hipx, -shouldery, 0.0);
//translates back to the original drawing position
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
//Sets active polygon mode
glCallList(leftarmList);
//calls an arm to be drawn
glPopMatrix();
//end this matrix in stack
See what went wrong? Your translating, rotating, then just translating back to where you were.
I’m not sure what your trying to do, but it looks like you want the leg to go up, rotate then come back down (the negative direction of the first translation).