Results 1 to 2 of 2

Thread: Setting the origin of an object in OpenGL

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Location
    United Kingdom
    Posts
    20

    Setting the origin of an object in OpenGL

    I'm rendering 3D text to the screen. First I translate into the screen by 6 so the object is visible then rotate it on the Y axis.

    The problem is this: When OpenGL draws the 3D text it renders it so that the origin of the object is in the top left corner. When it rotates on the Y axis it rotates around this origin. So...

    How do I set the origin to be the centre of the 3D text rather than the top left so that it will rotate on the spot (without moving left or right)?

    Translating doesn't work because it moves the object. I don't want to move the object just the coordinate system. Anyone understand this?

  2. #2
    Junior Member Newbie
    Join Date
    Jan 2001
    Location
    California
    Posts
    22

    Re: Setting the origin of an object in OpenGL

    To spin an object around its center:

    1. translate to center the object in the coordinates system.

    2. rotate.

    3. translate to position the object where you want it to be.

    (edited for clarity)

    [This message has been edited by BlueJ (edited 08-20-2003).]

Similar Threads

  1. Having a object move around the origin
    By Slong in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-17-2009, 05:37 PM
  2. Loading and setting a 3d object in Opengl.
    By tiregarfio in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 08-15-2006, 11:00 PM
  3. is tex env setting bind to texture object
    By Nil_z in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-21-2004, 11:52 PM
  4. Rotating a 3-D object centerd at the origin
    By ELIMT in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-04-2001, 02:25 PM
  5. Replies: 2
    Last Post: 06-17-2001, 12:44 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