View Full Version : How to Rotate A Box Around A Pivot

10-06-2007, 01:01 AM
How can be rotated a box around a pivot?

For example box dimension is 2cm X 5cm X 20cm.

And if we want to rotate box around centre of the box, how can it be? (Pivot is centre of the box)

( glRotatef )

10-06-2007, 09:01 AM
1. Translate( - PIVOT )
2. Rotate
3. Translate( PIVOT )

(Do appropriate OpenGL commands in reverse order).