Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bounding box for skinned mesh #20434

Closed
mshamaseen opened this issue Sep 30, 2020 · 2 comments
Closed

bounding box for skinned mesh #20434

mshamaseen opened this issue Sep 30, 2020 · 2 comments

Comments

@mshamaseen
Copy link

Describe the bug

I am not sure if this a gltf bug or a three js bug but when exporting a skinned mesh with an armature with a specific scale the bounding box will not work correctly, for example, I have an object with an armature of scale 0.018 for all axes and a mesh child with a scale of 1; what happens when I import it to threejs/editor is the bounding box take the scale of the armature, as the image below:
image

and, via coding, when I try to get the object size by:

let measurementBox = new THREE.Box3().setFromObject( this.threeJsObject ); measurementBox.getSize(this.objectSize);

the result is the armature mesh child size (after scaling) multiplied by the armature scale again!
This means if the x dimension of a mesh after being scaled by an armature is 100 with a scale of 0.5 in the armature (actual size of the mesh is 200 then), the bounding box x size will be 50 and not 100, it will scale too after the mesh!

To Reproduce
here is the file that I am using, the armature scale is 0.018 and the bounding box is 0.018 of the actual size of the mesh rather than being 100% of the actual size of the mesh.

https://drive.google.com/file/d/14Iq0pUmHt1uE3F0brMIVfFL5taV2MEZs/view?usp=sharing

Steps to reproduce the behavior:

  1. just import it in threejs/editor and check the bounding box!

Expected behavior

the bounding box surrounds all the mesh and not being multiplied with the armature scale, it should be like the image below:
image

Platform:

  • Device: Desktop
  • OS: Linux, ubuntu
  • Browser: All
  • Three.js version: r120
@gkjohnson
Copy link
Collaborator

gkjohnson commented Sep 30, 2020

This is a known issus with SkinnedMesh bounding boxes -- there are some related discussions in #18334, #18245, #14499

@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 30, 2020

Marking this as a duplicate of #14499.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants