Results 1 to 3 of 3

Thread: Getting my head around rotations.

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    9

    Getting my head around rotations.

    I'm currently learning openGL, and want to fully cover rotations before moving on.

    I have worked out how to rotate an object around its centre, simply draw it around the origin, move it into view, then rotate it. The thing that's troubling me is, is there a way to rotate the object about a different point, without changing the point at which it is drawn at?

    Ie, still draw the object at origin, and move it into view, but rotate it, say, about the origin, so it orbits the origin.

  2. #2
    Senior Member Regular Contributor Rosario Leonardi's Avatar
    Join Date
    Aug 2008
    Location
    Italy
    Posts
    356

    Re: Getting my head around rotations.

    If you rotate around a different pivot the object will also move... it's maths.

    To do that you can:
    glTranslate(myPivotPoint);
    glRotate(myAngle, myAxes);
    ~ ~ I tell you, realtime 3D is made of blood, sweat and screams! ~ ~

  3. #3
    Member Contributor
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    60

    Re: Getting my head around rotations.

    jup just translate the Object and rotate than.
    But rember transformation are done from "inside out".
    so in code:

    glRotate() // rotate
    glTranslate() // chage point of rotation

    draw()

Similar Threads

  1. Perspective projection of a 3D head
    By mathewi9 in forum OpenGL: General
    Replies: 1
    Last Post: 01-19-2013, 12:28 AM
  2. head files
    By xiaomage in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-22-2012, 05:22 AM
  3. Newbie in Over-Head
    By DrSpitfire in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-13-2009, 05:59 PM
  4. drawing a head
    By pavlov123 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-07-2003, 11:29 AM
  5. How to do a head-up Display?
    By in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-04-2000, 08:35 PM

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