Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Morph Targets Three.js

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

like image 819
user2517605 Avatar asked Jul 30 '13 16:07

user2517605


2 Answers

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();

like image 107
potomek Avatar answered Sep 28 '22 05:09

potomek


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.

like image 23
Dov Jacobson Avatar answered Sep 28 '22 06:09

Dov Jacobson