2

I created a morph animation (default: a slim avatar and shape key: a fat avatar) on blender and now I am trying to export it to three.js and display it using a slider. So, when the slider is dragged to right or left, the avatar changes its shape, getting fatter or slimmer. But I do not know how to program in javascript this functionality. Can someone help me please?

PurkkaKoodari
  • 6,703
  • 6
  • 37
  • 58

1 Answers1

0

You can use dat.gui as a slider and morphTarget to effect the vertices position for this.

You can read the source code from this example.

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

But Basically, you push morphTarget to geometry and use mesh.morphTargetInfluences to effect the influence of the morph target vertices.

wizztjh
  • 6,979
  • 6
  • 58
  • 92
  • What are morphTargetInfluences and how do they work? –  Sep 08 '15 at 11:51
  • 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]. http://stackoverflow.com/questions/17952916/morph-targets-three-js – wizztjh Sep 10 '15 at 05:54
  • accept and upvote the answer if you think it answers your question. – wizztjh Sep 10 '15 at 05:55