1. ## OpenGL Rotation

hi alll!!
I need to rotate a 3D object about its origin..This topic was already discussed earlier.. Anyways Its just the continuation of this thread..
http://cboard.cprogramming.com/archi...p/t-61196.html

Can the same person(Darkness) elaborate on this..

2. My problem statement: I am displaying a .wrl file successfully. Now i need to rotate on the screen based on mouse interaction. Now I am able to rotate that object with respect to screen's origin, i want the object to rotate with respect to its center point..

3. When you use matrices to rotate something, it is only possible to rotate about the origin. To rotate around the center, you need to move you mesh to the origin, then rotate it, and then move it back

4. I echo what h3ro said.

To really understand why it is this way, you need to take to learn linear algebra and then study matrix transformations in computer graphics. But the jist of it is: translate the object to the origin, rotate it, translate it back to its original position.

5. I know that actually.. The problem is i don't know how to move to origin for that object being displayed.. ??

6. i hav provided options such as zoom in and zoom out. When i zoom out and rotate, rotation takes place but does not rotate within that object's center. It rotates with respect t sceen's center point so it takes a huge diameter...

7. is the object is at 10,10,10 then just move it -10,-10,-10, then rotate

8. ok i wil try n let u know sooon..

9. thanks guys.. It worked successfully..