-
Rotating GL_QUADS
I'm making a cube spin on my own. This is just practice before I start coding for my game. I've read in my book that I can use glRotatef to rotate any three axis. But if I do this won't it rotate every cube on the screen because they're all affected my the axis rotation. How can I rotate just one cube. Or better yet how can I rotate its corner coordinates.
I guess I'm asking if OGL has a rotation function for vectors not the axis, any ideas? Also, if not, does anyone have any samples/tutorials that would help me with this?
Thanks!
NOMAD
-
Try http://nehe.gamedev.net/ - a great resource for OpenGL programming. I am guessing that when you rotate a certain cube, you change the variable value of the axis and then you draw the cube you want to rotate using the variable you just changed. But there is a whole tutorial of rotating and stuff on nehe so check it out.
-
Nomad - Check out glPushMatrix and glPopMatrix :)
-
Thanks once again Parksie, thats what I'm talking about. I havn't quite tried them (linker errors) but I'm pretty sure thats what I need.
NOMAD