Results 1 to 4 of 4

Thread: rotating........

  1. #1

    rotating........

    ok i'm very new to OpenGL just got everything working /linking/ and stuff which took me two days to get! now i juade made this human with spheres and cubes, it looks pretty cool but the think is i want to be able to rotate the guy and see is back and is side........i know about the glRotatef function but not quite sure how to use it....can someone shed a little light on this please.....thank you

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2004
    Location
    Montreal
    Posts
    132

    Re: rotating........

    You call glRotate just before rendering your object and you do that to the modelview matrix.
    If you're new, post to the beginners group. Besides, there are tons of demoes out there such as at the ati and nvidia site.

    V-man

  3. #3
    Senior Member Regular Contributor
    Join Date
    Sep 2004
    Location
    Montreal
    Posts
    132

    Re: rotating........

    woops, this is the beginners forum!

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    352

    Re: rotating........

    glRotatef makes a rotation around an axis. You have to specify the angle of rotation, together with the (x,y,z)-coordinates of a vector lying on this axis. The call looks like :
    glRotatef (angle_in_degrees, axis_x, axis_y, axis_z);
    for example, you could write glRotatef (180, 0, 1, 0); if you want to make an half turn around the y-axis.

    P.S.: you have to call glRotatef BEFORE drawing your model. Your display function should look like

    glClear(...);
    glLoadIdentity (); //cancels old calls to glRotatef
    glRotatef(...);
    DrawMyModel ();
    glutSwapBuffers (); //if you're using glut
    I hope that this will help.

    [This message has been edited by Morglum (edited 07-26-2001).]

Similar Threads

  1. Rotating Objects - Light Rotating not expected
    By SparkyNZ in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-12-2015, 07:52 PM
  2. rotating around a point which itself is rotating
    By xman84 in forum OpenGL: General
    Replies: 1
    Last Post: 03-30-2011, 09:14 PM
  3. Rotating around a point and Rotating across own axis
    By Mighty in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-10-2004, 10:15 PM
  4. rotating and object without rotating its axis
    By scam in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 12-17-2003, 08:30 AM
  5. Problem rotating parent then rotating children
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-04-2002, 11:15 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