# The Industry's Foundation for High Performance Graphics

1. ## Rotation of object

How to ratate the 3D object arround itself in all the axis.

glRotatef(0.0,0.858824f,0.576471f,0.439216f);

I use this cases to rotate my object arround the axis.
case 'l':
glRotatef(-1.0,1.0f,0.0f,0.0f);
break;
case 'r':
glRotatef(-1.0,0.0f,0.0f,1.0f);
break;
case 'd':
glRotatef(-1.0,0.0f,1.0f,0.0f);
but i wand how to rotate object itself.

2. Rotation transforms are typically about the origin. If you want to rotate about a different point, you have to translate that point to the origin first, then apply the rotate.

3. Originally Posted by Dark Photon
Rotation transforms are typically about the origin. If you want to rotate about a different point, you have to translate that point to the origin first, then apply the rotate.
... then translate back.

The sequence
Code :
glTranslatef(x, y, z);
glRotatef(...);
glTranslatef(-x, -y, -z);
constructs a rotation about the point (x,y,z).

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•