The simple version of my project is rotating a sphere based on user input.
However my rotations get weird after multiple rotations in certain situations due to openGL's local coordinate system. What I really need is to rotate based on a world/fixed coordinate system. Such that when I rotate the sphere once its rotation axes are not rotated as well. This issue is explained here http://www.opengl.org/resources/faq/technical/transformations.htm at 9.070.
I understand all that. However setting up what they suggest is a bit beyond my skill level. Does anyone have any experience with this? I tried using some code I found here http:// chaosengineer.com/?cat=19 but had no luck.
Here is the basic code I am using.
glPushMatrix();
//draw in middle of the screen
glTranslatef(ofGetWidth()/2,ofGetHeight()/2,0);
glRotatef(xRot,1,0,0);
glRotatef(zRot,0,0,1);
glTranslatef(-ofGetWidth()/2,-ofGetHeight()/2,0);
ofSetColor(255, 255, 255, 255);
squirrelModel.draw();
glPopMatrix();