I’ve forked a Pen by Captain Anonymous to try and include a rotation as below:
I can’t understand how to resolve the scaling of the Bounding Box when you rotate. I’ve followed several posts on here explaining you have to scale by the difference of the original object by the new Bounding Box but whatever I try fails and looks like a messy solution (even if it did work).
Can anyone help me out.
Are you referring to the varying size of the cylinder’s AABB? It seems this is the expected behavior since according to the orientation of the cylinder its geometry has slightly different extends along the cardinal axes.
If you don’t want this effect I suggest you hard-code the dimensions of the AABB and just translate it according to the mesh’s position. Or you increase the detail of the cylinder’s geometry by creating it like so:
new THREE.CylinderBufferGeometry( 1 , 1 , this._height , 32 ),.