I made a 3D scene and enabled the six opengl’s clip planes by calling:


I put a interface to the user interact and clip the scene. It was right, works perfectly.
When you “clip” the scene, its center move away (the direction it moves depends on the clip plane you are moving).
So, I would like to know how could I keep translating my scene based on its center (the up-to-date center), I mean, when you move a clip plane you “reduce” the scene and a new center should be found to rotate based on this new center.
Someone can help me ?!
Thanx a lot,


Rotating around a pivot point (pivot specified in object coordinates):

glTranslatef(pivot[0], pivot[1], pivot[2]);
glTranslatef(-pivot[0], -pivot[1], -pivot[2]);

I hope that helps.


Dear Ilkka, thanxs for you anwers, by I thing that is not right, because when you rotate the axys you can not simply translate back to that pivot point, if you do that the system cordinates origin will not be at the same place it was before the operation, that means the scene will be drawn in some place you do not want…
Do you agree ?!

I think it’s correct, but I agree it doesn’t look that way. But that’s just the local coordinate system, some things are weird with it. That code comes from a working program (with some modifications), so it really should work. Try it