I am trying to create a mesh that contain all triangles generate by following a path in realtime. I think problem is that geometry is not properly updated and because it not visualize nothing. Triangles are created with positions of the green cubes that follow animated over time the text Spline lines.
how I create:
var geometryHandFont = new THREE.Geometry();
geometryHandFont.dynamic = true;
var materialHandFont = new THREE.MeshBasicMaterial({
color: 0xffffff, wireframe:true, side: THREE.DoubleSide
});
this.handFont = new THREE.Mesh(geometryHandFont, materialHandFont);
this.handFont.geometry.dynamic = true;
How I update each frame:
this.handFont.geometry.vertices.push(tl);
this.handFont.geometry.vertices.push(tr);
this.handFont.geometry.vertices.push(br);
// triangle 2
this.handFont.geometry.vertices.push(tr);
this.handFont.geometry.vertices.push(br);
this.handFont.geometry.vertices.push(bl);
this.handFont.geometry.faces.push(new THREE.Face3(this.f++,this.f++,this.f++));
this.handFont.geometry.faces.push(new THREE.Face3(this.f++,this.f++,this.f++));
this.handFont.geometry.verticesNeedUpdate = true;
this.handFont.geometry.elementsNeedUpdate = true;
this.handFont.geometry.computeBoundingBox();
this.handFont.geometry.computeFaceNormals();
this.handFont.geometry.computeVertexNormals();
Code: http://jsfiddle.net/mcanet/6cr6R/3/
And some screenshot: https://www.flickr.com/photos/mcanet/14094429489/
I am using Three.js version 67. If someone can help me with that it would be much appreciated :)