|
-
Jun 16th, 2002, 12:31 PM
#1
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
-
Jun 16th, 2002, 12:51 PM
#2
PowerPoster
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.
-
Jun 16th, 2002, 01:17 PM
#3
Monday Morning Lunatic
Nomad - Check out glPushMatrix and glPopMatrix
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 16th, 2002, 04:25 PM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|