Any way to get a bounding box from a three.js Object3D?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm loading an OBJ file using Three.js and OBJLoader.js. This returns a Three.Object3D object, which has what you'd expect from a 3D model (position vector, up vector...) What I can't figure out is how to get a bounding box for it-- is this possible? 回答1: You don't need to iterate over all children of the object; there's a method in the library to do this: THREE.Box3#setFromObject : see the docs . For example, you can do: var bbox = new THREE.Box3().setFromObject(obj); to get the bounding box of obj , including all of its children, and