0

I am dynamically adding meshes to an Object3D and was wondering if it was possible to get the center of the object such that I can do rotations and on translations equally on the whole mesh and not 'centered' on one end. I know you can access the geometry property of Mesh but I couldn't find an equivalent for Object3D.

Thanks!

Adam Ashwal
  • 1,472
  • 1
  • 19
  • 36

1 Answers1

1

You can use box3.setFromObject(Object3D) to figure out the bounding box of your object and from that the center of your object3D. Take a look at Threejs: computing the bounding box of rotated text and Three.js How to get position of a mesh?. I think they will help you.

Community
  • 1
  • 1
gaitat
  • 12,449
  • 4
  • 52
  • 76