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

glTF 2.0 Morph targets model is not displayed #11326

Closed
4 of 13 tasks
cx20 opened this issue May 13, 2017 · 9 comments
Closed
4 of 13 tasks

glTF 2.0 Morph targets model is not displayed #11326

cx20 opened this issue May 13, 2017 · 9 comments
Labels

Comments

@cx20
Copy link
Contributor

cx20 commented May 13, 2017

Description of the problem

I am testing glTF 2.0 sample models and Three.js glTF 2.0 Loader.
https://github.com/cx20/gltf-test/tree/2.0#simple-models-for-testing-individual-features

However, it seems that morph targets model is not displayed.

Model : Animated Morph Cube
https://github.com/HowardWolosky/glTF-Sample-Models/tree/morphAnimation/2.0/AnimatedMorphCube
image

Three.js + glTF Loader Result is NG
Babylon.js + glTF Loader Result is OK

Model : Animated Morph Sphere
https://github.com/HowardWolosky/glTF-Sample-Models/tree/morphAnimation/2.0/AnimatedMorphSphere
image

Three.js + glTF Loader Result is NG
Babylon.js + glTF Loader Result is OK

Three.js version
  • Dev
  • r85
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)

ThinkPad X260 + Windows 10 + Intel HD Graphics 520

@Mugen87 Mugen87 added the Bug label May 13, 2017
@takahirox
Copy link
Collaborator

takahirox commented May 14, 2017

GLTF2Loader doesn't support it yet but maybe we do soon #10806

@takahirox
Copy link
Collaborator

BTW is SimpleMaterial.gltf in your repository correct?
It doesn't seem to have a parameter corresponding to position attribute.

https://github.com/cx20/gltf-test/blob/7abbfeb846a887b7dd08adea3f631d112d0a764f/tutorialModels/SimpleMaterial/glTF/SimpleMaterial.gltf#L86-L110

@donmccurdy
Copy link
Collaborator

@takahirox are you started on this? I have also done a bit of work here: dev...donmccurdy:feat-gltf-morphtargets

^it isn't doing anything yet, though.

@takahirox
Copy link
Collaborator

Yeah, I've started. Looks like our progresses are same haha.

@donmccurdy
Copy link
Collaborator

haha ok, we need a trello board or something 😆
I don't plan to do more for a couple days, so carry on!

@donmccurdy
Copy link
Collaborator

This is fixed now — if the model contains animation clips for the morph targets, they can be played as usual. If it contains morph targets alone, they are mutated with:

mesh.morphTargetInfluences[0] = 0.0;
mesh.morphTargetInfluences[0] = 0.1;
// ...
mesh.morphTargetInfluences[0] = 1.0;

@Mugen87 Mugen87 closed this as completed May 20, 2017
@cx20
Copy link
Contributor Author

cx20 commented May 20, 2017

I confirmed that the model is displayed correctly.

AnimatedMorphCube is OK
AnimatedMorphSphere is OK

@samwei12
Copy link

@donmccurdy
hi, how can I get mesh attributes from a glTF loader object?

@donmccurdy
Copy link
Collaborator

@samwei12 If you mean attributes like vertex positions and normals, it doesn't actually matter what loader or model format you used to create the THREE.Mesh:

result.traverse(function(node) {
  if (node.isMesh) {
    console.log(node.geometry.attributes);
  }
});

See THREE.BufferGeometry for more details.

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