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!

Answer: Use glViewPort!!


  • Translate
  • Rotate
  • Translate back

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.

glTranslatef(point.x, point.y, 0);
glRotatef(_rotate, 0.0f, 0.0f, 1.0f);

What did I miss ?

Ok, I forgot the translate back…

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

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.