Results 1 to 2 of 2

Thread: Correct rotating an object in glOrtho2d

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2011
    Posts
    1

    Correct rotating an object in glOrtho2d



    I want to rotate my object on its own center in glOrtho2D, now my object rotate on its top-left point. It is not good for me.

    In 2d, where is x,y, and z coords too, it works perfect, but not in glOrtho, why?

    What is the solution?

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2011
    Location
    Norrköping, Sweden
    Posts
    9

    Re: Correct rotating an object in glOrtho2d

    The top left point for your object is the objects origo so to say.
    If you want to rotate around its center you first have to translate(move) the object so its center is in its origo and then move it back

    eg:
    translate to point
    rotate
    translate back

Similar Threads

  1. Replies: 0
    Last Post: 10-28-2014, 08:51 PM
  2. Background object drawn in foreground. How to correct?
    By Ravenik in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-03-2014, 09:21 AM
  3. rotating and object without rotating its axis
    By scam in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 12-17-2003, 08:30 AM
  4. newbie GLOrtho2d question
    By Raketman in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-03-2001, 01:56 AM
  5. how do I calculate correct angles to an object ?
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-20-2000, 05:24 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