Morph Targets Three.js
Asked Answered
L

2

13

I'm trying to get started with morph targets and three.js. However, there doesn't seem to be much documentation on this subject.

As I'm looking at the source code, morphTargetInfluences[] seems to be the magic.

How does this work? How do I use this? Is a value of 1 full strength? How can I differentiate between different morph targets on the same model?

I'm just trying to understand morphTargetInfluences[]

Thanks in advance

Latham answered 30/7, 2013 at 16:51 Comment(2)
Could you maybe clear up the your question a little so that it's more concise? It appears you're essentially asking how morphTargetInfluences works, so maybe focus on that a little more.Quartermaster
Sorry, edited my question.Latham
H
10

http://threejs.org/examples/webgl_morphtargets.html

Morph targets are sets of geometry vertices positions for automatic interpolation between them. You can change geometry appearance in real time, using different vertices positions written in morphTargetInfluences[0], morphTargetInfluences[1], morphTargetInfluences[nSet]. You can mix many appearances (morphTargetInfluences) of geometry at the same time. Best way is JSONLoader format, wchich you can export from 3DSMax for example: frame0 as morphTargetInfluences[0], frame1 as morphTargetInfluences[1], ect.

The original geometry vertices are untouched, which you can check using geometry.computeBoundingBox(); geometry.boundingBox();

Hexaemeron answered 31/7, 2013 at 15:32 Comment(0)
H
3

I would be cautious about pursuing this approach. It seems to be based on an incomplete understanding of the technology.

  1. The value of Morph Targets is not that you can animate by swapping out individual vertices, but that you can use an alternative shape (same mesh with same vertices, but each can be in a new location) as a deformation target for your model. (eg: Neutral Face and Smile Face)

  2. The morphTargetInfluence contains NO vertices. It is an array of scalar values that represent the weight assigned to each target during the morph. In the Face example above, [0.3] might result is a timid Mona Lisa-like smile, while [0.9] would be a robust grin.

Hogan answered 27/10, 2017 at 7:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.