Results 1 to 6 of 6

Thread: Rotation about an axis other than 0,0,0

  1. #1

    Rotation about an axis other than 0,0,0

    What is the best way to implement rotation for an object about its own axis (as opposed to the origin, which glRotate does) in OPENGLES? Thanks in advance!

  2. #2
    Answer: Use glViewPort!!

  3. #3
    Senior Member
    Join Date
    May 2006
    Posts
    353


    - Translate
    - Rotate
    - Translate back
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  4. #4
    Junior Member
    Join Date
    Jul 2008
    Posts
    7

    Re: Rotation about an axis other than 0,0,0

    Well I alos got an issue with rotation:

    I use glTranslate / glRotate to rotate my object around its own axis, fine.
    But in fact my object is making circles around that axis, and the farer I am from the origin, the bigger is the circle.
    I just want it to rotate around the point where I'm drawing it.
    Code :
    glTranslatef(point.x, point.y, 0);
    glRotatef(_rotate, 0.0f, 0.0f, 1.0f);

    What did I miss ?

  5. #5
    Junior Member
    Join Date
    Jul 2008
    Posts
    7

    Re: Rotation about an axis other than 0,0,0

    Ok, I forgot the translate back...

  6. #6

    Re: Rotation about an axis other than 0,0,0

    If you are going to use matrix multiplication, dont forget the order of the matrix multiplication should be backward

Similar Threads

  1. Rotating Object about different axis
    By naveen in forum OpenCL
    Replies: 0
    Last Post: 07-29-2011, 01: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
  •