-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Emiliano/210 #852
Emiliano/210 #852
Conversation
…escription.It loooks like the animation example is old (glTF1.0) I am leaving it as is to avoid conflicts
specification/2.0/README.md
Outdated
#### Morph Targets | ||
|
||
Morph Targets are defined by extending the Mesh concept. | ||
A Morph Target is a morphable Mesh where primitives' attributes are obtained by adding the original attributes to a weighted sum of targets attributes (this operation corresponds to COLLADA's `RELATIVE` blending method). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to show equation than use external COLLADA reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed. Thanks
specification/2.0/README.md
Outdated
|
||
Morph Targets are defined by extending the Mesh concept. | ||
A Morph Target is a morphable Mesh where primitives' attributes are obtained by adding the original attributes to a weighted sum of targets attributes (this operation corresponds to COLLADA's `RELATIVE` blending method). | ||
Morph Targets are implemented via the `targets` property defined in the Mesh `primitives`. Each target in the `targets` array is a dictionary mapping a primitive attribute to a Morph Target displacement, currently only two attributes ('POSITION' and 'NORMAL') are supported. All primitives are required to list the same number of `targets` in the same order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each target ... mapping a primitive attribute to a Morph Target displacement
... mapping a primitive attribute to an accessor containing Morph Target displacement data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
] | ||
} | ||
], | ||
"weights": [0, 0.5] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still not quite obvious to me, why do we have two ways of defining initial morph state: mesh.weights
and node.weights
. Just asking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mesh.weights
are the Morph Targets default weights.
node.weights
are the instantiated Morph Targets weights (that override the weights of the mesh).
Say that you have a Morph Target, it is a character face. You want to instantiate it multiple times in your scene, and you want to instantiate it as a smiling face. Then just set the default mesh.weights
accordingly (make it smile!) and don't set the instantiation weights node.weights
when you instantiate it within a node.
Makes sense?
@@ -31,6 +31,14 @@ | |||
"default" : 4, | |||
"gltf_detailedDescription" : "The type of primitives to render. All valid values correspond to WebGL enums." | |||
}, | |||
"targets" : { | |||
"type" : "array", | |||
"description" : "An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only "POSITION" and "NORMAL" supported) to their deviations in the Morph Target.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-quotes must be escaped here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
@lexaknyazev I addressed your concerns, back to you. Thanks |
Implementing Morph Targets as discussed in #210.
@lexaknyazev all yours!