简体   繁体   中英

Three.js Buffergeometry Morphing

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM