Morph Targets Three.js

user2517605 picture user2517605 · Jul 30, 2013 · Viewed 9.6k times · Source

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

Answer

potomek picture potomek · Jul 31, 2013

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