Question on the pivot point of rotation (r134)

I’m using new TransformControls to rotate the object. When the object is regular, such as a cube or a ball, the pivot point can be easily derived. But when it comes to the rotation of objects of complex shapes, the pivot point is not expected. So far I cannot figure out how to derive this pivot point after rotation. Any idea is appreciated.

Have you tried to compute the AABB of the model and then extract its center point? That is usually a good pivot. However, keep in mind that an AABB is axis-aligned so for rotated objects the box might not look as expected. Nevertheless, the code looks like so:

const aabb = new THREE.Box3().setFromObject( object );
const center = aabb.getCenter( new THREE.Vector3() );

You can use this center point to compute the offset from the 3D object’s current origin. Use the offset to translate the geometry via BufferGeometry.translate().

Thank you, it works.