Results 1 to 4 of 4

Thread: Stupid question on glRotatef

  1. #1

    Stupid question on glRotatef


    OK I have a question which I'm sure has a simple answer, but I don't know what it is!

    Can someone please tell me what the difference is between using:




    Because no matter which one I use, it still rotates my object by exactly the same angle! In fact, no matter what I put for the Z value (unless it's zero), it always has exactly the same effect.

    Can someone plese enlighten me?!

    And also, if there's a reason for using one instead of the other, can anyone give me an example of where you might use it?

    Many thanks!!

    Danny G

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jul 2001

    Re: Stupid question on glRotatef

    glRotate* (angle, x,y,z) rotates about angle degrees around the axis defined by (x,y,z).
    So what's the difference between the axis (0,0,1) and (0,0,100000000000) ? None.

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Feb 2004
    Long Island, New York

    Re: Stupid question on glRotatef

    The glRotate function takes a number of degrees and the last 3 parameters define a vector to rotate about.

    This vector is internally normalized so no matter what you pass as z, as long as it's a positive value you're defining a vector that points out of the screen.

    For this reason the vector (0,0,.5) is the same exact vector as (0,0,1) as far as OpenGL is concerned when it comes to rotation.

  4. #4

    Re: Stupid question on glRotatef

    Ah, I get it now. It's a vector in the same way that a normal is a vector to a face...? So it has a value between 0.0 to 1.0, and whichever direction the vector points in, this is the axis around which it rotates. I think!

    I'll have another play around with it anyway, and see if it makes sense.

    Many thanks!!

    Danny G

Similar Threads

  1. Another stupid question
    By ViKt0r Erdelyi in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-08-2005, 04:33 AM
  2. stupid stupid question - Installing OpenGL?
    By JonnyW in forum OpenGL: Linux
    Replies: 3
    Last Post: 02-01-2004, 05:44 PM
  3. Maybe a stupid question
    By J_Ramone in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-04-2001, 12:29 PM
  4. Sorry for this stupid question
    By in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 10-12-2000, 08:46 AM
  5. glRotatef() - A newbie question... please help
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 09-18-2000, 03:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean