Loaded the model without morphTargets initially and cloned the geometry. Using webworker read the file containing morphTargets alone and converted as THREE object using this code
i = timeStep;
dstVertices = [];
srcVertices = morphTargets.vertices;
for (v = 0, vl = srcVertices.length; v < vl; v += 3) {
var vertex = new THREE.Vector3();
vertex.x = srcVertices[ v ];
vertex.y = srcVertices[ v + 1 ];
vertex.z = srcVertices[ v + 2 ];
dstVertices.push(vertex);
}
geo.morphTargets.push(dstVertices);
timeStep += 1;
On later stage created the new geometry included vertices and faces from the cloned geometry and dstVertices as morphTargets.
Removed the previously created mesh from the scene and added the newly created mesh containing morphTargets.
console is throwing this error:
Uncaught TypeError: Cannot read property '52' of undefined
at setMeshBuffers (three_70.js:18797)
at updateObject (three_70.js:21142)
at THREE.WebGLRenderer.renderBuffer (three_70.js:19970)
at renderObjects (three_70.js:20681)
at THREE.WebGLRenderer.render (three_70.js:20544)
at animate (index1.php:70)
Can anyone guide me where I am going wrong?