public void rotate ( Quaternion rotation , Point3D pivot ) { if ( pivot != null ) { // Change the center Transform3D m1 = new Transform3D ( ) ; m1 . setTranslation ( - pivot . getX ( ) , - pivot . getY ( ) , - pivot . getZ ( ) ) ; Transform3D m2 = new Transform3D ( ) ; m2 . setRotation ( rotation ) ; Transform3D m3 = new Transform3D ( ) ; m3 . setTranslation ( pivot . getX ( ) , pivot . getY ( ) , pivot . getZ ( ) ) ; Transform3D r = new Transform3D ( ) ; r . mul ( m1 , m2 ) ; r . mul ( m3 ) ; r . transform ( this . getCenter ( ) ) ; } rotate ( rotation ) ; }
Rotate the box around a given pivot point . The default pivot point of the center of the box .