1

I'm trying to draw a boundingbox around a skinned model:

const box = new THREE.BoxHelper(trooper, 0xff0000);
scene.add(box);

https://jsfiddle.net/66sor15y/4/

As you see the model doesn't fit the bounding box. I filed an issue to understand the problem, but I still have issues drawing the actual box.

https://github.com/mrdoob/three.js/issues/13989

Any help would be highly appreciated!

blockwork
  • 185
  • 1
  • 10
  • Double-check the transformations in the Collada model. It looks like there are several non-identity matrices. A bounding box defines a world-space box which surrounds the geometry, regardless of transformation matrix. If you want your wireframe box to surround a particular mesh, you'll need to transform it using the same matrices the mesh uses to position its self. – TheJim01 May 04 '18 at 16:34
  • 1
    You should bear in mind that `ColladaLoader` automatically creates skinned meshes and sets `material.skinning` to true. Check out how the trooper looks like if `skinning` is set to false. https://jsfiddle.net/66sor15y/5/ – Mugen87 May 04 '18 at 19:31
  • Mugen87's answer of this post is helpful: https://stackoverflow.com/questions/57332347/three-js-get-updated-vertices-with-skeletal-animations – Xiaoqi Mar 09 '23 at 09:01

0 Answers0