OpenGLES rotation in fixed coordinate system
Posted
by Jenicek
on Stack Overflow
See other posts from Stack Overflow
or by Jenicek
Published on 2010-05-24T17:27:22Z
Indexed on
2010/05/24
17:31 UTC
Read the original article
Hit count: 372
Hi,
I'm having real trouble finding out how to rotate an object arround two axes without changing axes orientation. I need only local rotation, first arround X axis and then arround Y axis(only example, it doesn't matter how many transformations arround which axes) without transforming the whole coordinate system, only the object. The problem is that if I'm using glRotatef arround X axis, the axes are rotated also and that's what I don't want. I've red bunch of articles about it but it seems I'm still missing something. Thanks for every help.
To have some sample code here, it's something like this
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(rotX, 1.0f, 0.0f, 0.0f);
glRotatef(rotY, 0.0f, 1.0f, 0.0f);
drawObject();
but this transforms the coordinate system also.
© Stack Overflow or respective owner