Smooth shading during streaming (oh yes baby)

This commit is contained in:
Thomas FORGIONE 2015-04-09 17:07:07 +02:00
parent 3bd6420736
commit 0037b38357
1 changed files with 7 additions and 1 deletions

View File

@ -57,10 +57,16 @@ ProgessiveSphere.prototype.addFace = function() {
)); ));
// Add the new face // Add the new face
this.geometry.faces.push(new THREE.Face3(this.current_face, this.current_face+1, this.current_face+2)); this.geometry.faces.push(new THREE.Face3(
this.geometry.vertices.length-3,
this.geometry.vertices.length-2,
this.geometry.vertices.length-1
));
// Update the stuff // Update the stuff
this.geometry.mergeVertices();
this.geometry.computeFaceNormals(); this.geometry.computeFaceNormals();
this.geometry.computeVertexNormals();
this.current_face += 3; this.current_face += 3;
this.geometry.elementsNeedUpdate = true; this.geometry.elementsNeedUpdate = true;
this.geometry.normalsNeedUpdate = true; this.geometry.normalsNeedUpdate = true;