3

Is it possible to morph two buffergeometries in three.js? Is there a good example to reference? I am especially interested in manually morphing using morph target influences.

Wilt
  • 41,477
  • 12
  • 152
  • 203
Jeff Weinberg
  • 414
  • 4
  • 9
  • Since you can use the attributes of the second geometry as your morph targets, this answer may help: http://stackoverflow.com/a/44092250/1314762 – Don McCurdy May 21 '17 at 01:12

1 Answers1

1

One possible solution is to literally manually do the morphing.. below is what I did, I'm also looking for a more elegant solution. Besides, I'm not so sure about the performance issues here.

    for (var b = 0; b < 5; b++) {   // iterate through 5 morph targets

        var deltaVertices = blendshapes[b].children[0].geometry.attributes.position.array;

        for (var i = 0; i < vertices.length; i++) {
            // blend other shapes as delta to the Neutral one
            3D_Model.children[0].geometry.attributes.position.array[i] +=  weight_b * deltaVertices[i];
        }
    }

"blendshapes" are loaded OBJ 3D Models using OBJLoader.js

lakex24
  • 51
  • 1
  • 8
  • Thanks for your solution, I will give it a try. I tweeted the same question at @mrdoob and he said that this will part of the next release. – Jeff Weinberg Mar 23 '15 at 16:16
  • I have two implementations working right now. one is attached above, the other is to actually use morph targets. the former one is CPU intensive, while the latter one is GPU heavy... – lakex24 Mar 23 '15 at 23:24