Browse Source

Cloning normals in Geometry.fromBufferGeometry(). Bad things happen otherwise.

Mr.doob 11 years ago
parent
commit
0a10887e50
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/core/Geometry.js

+ 1 - 1
src/core/Geometry.js

@@ -136,7 +136,7 @@ THREE.Geometry.prototype = {
 
 
 		var addFace = function ( a, b, c ) {
 		var addFace = function ( a, b, c ) {
 
 
-			var vertexNormals = normals !== undefined ? [ tempNormals[ a ], tempNormals[ b ], tempNormals[ c ] ] : [];
+			var vertexNormals = normals !== undefined ? [ tempNormals[ a ].clone(), tempNormals[ b ].clone(), tempNormals[ c ].clone() ] : [];
 			var vertexColors = colors !== undefined ? [ scope.colors[ a ], scope.colors[ b ], scope.colors[ c ] ] : [];
 			var vertexColors = colors !== undefined ? [ scope.colors[ a ], scope.colors[ b ], scope.colors[ c ] ] : [];
 
 
 			scope.faces.push( new THREE.Face3( a, b, c, vertexNormals, vertexColors ) );
 			scope.faces.push( new THREE.Face3( a, b, c, vertexNormals, vertexColors ) );