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

Bad default viewport/camera position for skinned meshes #147

Closed
vpenades opened this issue May 7, 2019 · 6 comments
Closed

Bad default viewport/camera position for skinned meshes #147

vpenades opened this issue May 7, 2019 · 6 comments
Labels

Comments

@vpenades
Copy link

vpenades commented May 7, 2019

I'm working with skinned meshes, and I'm having issues displaying the models I am creating.

Here's a test case: recursive tentacles

The model is showing up as intended in BabylonJS sandbox.

EDIT: the latest version of the tentacles model, which adds recursively generated skins (68 in total) makes all the viewers I know, except Babylon, to fail.

  • BabylonJS: Success!
  • three-gltf-viewer: nothing is shown
  • 3D Viewer: animates first mesh, another unanimated mesh shows up.
  • 3D Builder: just one unanimated mesh is shown.
  • https://www.virtualgis.io/gltfviewer Crashes!
@donmccurdy
Copy link
Owner

Thanks! Moving this issue to mrdoob/three.js#16475.

@donmccurdy
Copy link
Owner

Never mind, its a bug in this viewer (not three.js) after all – the model renders, but very small:

Screen Shot 2019-05-18 at 10 14 01 AM

I don't take animation or skinning into account when setting the initial camera position, and I suspect that's the problem here.

@benolayinka
Copy link

benolayinka commented Apr 19, 2020

i fixed this by adding an invisible BoxHelper to all the skinned meshes on import

see in sandbox

gltf.scene.traverse(mesh => {
        if (mesh.isSkinnedMesh) {
          const helper = new BoxHelper(mesh, "red");
          //helper.visible = false;
          this.scene.add(helper);
        }
      });

@MoppyDev
Copy link

Has anyone found a workaround for this yet?

@neciszhang
Copy link
Sponsor

i fixed this by adding an invisible BoxHelper to all the skinned meshes on import

see in sandbox

gltf.scene.traverse(mesh => {
        if (mesh.isSkinnedMesh) {
          const helper = new BoxHelper(mesh, "red");
          //helper.visible = false;
          this.scene.add(helper);
        }
      });

Wow. This is a temporary solution.Thanks.

@donmccurdy
Copy link
Owner

There's an upstream fix in three.js for this issue, which I've just pushed:

mrdoob/three.js#25612

I'm not sure it's a complete fix yet, and more work may be needed, please let me know if so.

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

No branches or pull requests

5 participants