Results 1 to 4 of 4

Thread: Rotating GL_QUADS

  1. #1
    NOMADMAN
    Guest

    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

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    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.
    Baaaaaaaaah

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  4. #4
    NOMADMAN
    Guest
    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
  •  



Click Here to Expand Forum to Full Width