浏览代码

Geometry: Reverted fromGeometry bugfix. See #7674.

Mr.doob 9 年之前
父节点
当前提交
3782cd1f9d
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/core/Geometry.js

+ 5 - 5
src/core/Geometry.js

@@ -214,7 +214,7 @@ THREE.Geometry.prototype = {
 		var indices = geometry.index !== null ? geometry.index.array : undefined;
 		var indices = geometry.index !== null ? geometry.index.array : undefined;
 		var attributes = geometry.attributes;
 		var attributes = geometry.attributes;
 
 
-		var vertices = attributes.position.array;
+		var positions = attributes.position.array;
 		var normals = attributes.normal !== undefined ? attributes.normal.array : undefined;
 		var normals = attributes.normal !== undefined ? attributes.normal.array : undefined;
 		var colors = attributes.color !== undefined ? attributes.color.array : undefined;
 		var colors = attributes.color !== undefined ? attributes.color.array : undefined;
 		var uvs = attributes.uv !== undefined ? attributes.uv.array : undefined;
 		var uvs = attributes.uv !== undefined ? attributes.uv.array : undefined;
@@ -226,9 +226,9 @@ THREE.Geometry.prototype = {
 		var tempUVs = [];
 		var tempUVs = [];
 		var tempUVs2 = [];
 		var tempUVs2 = [];
 
 
-		for ( var i = 0, j = 0; i < vertices.length; i += 3, j += 2 ) {
+		for ( var i = 0, j = 0; i < positions.length; i += 3, j += 2 ) {
 
 
-			scope.vertices.push( new THREE.Vector3( vertices[ i ], vertices[ i + 1 ], vertices[ i + 2 ] ) );
+			scope.vertices.push( new THREE.Vector3( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ) );
 
 
 			if ( normals !== undefined ) {
 			if ( normals !== undefined ) {
 
 
@@ -277,7 +277,7 @@ THREE.Geometry.prototype = {
 
 
 			}
 			}
 
 
-		};
+		}
 
 
 		if ( indices !== undefined ) {
 		if ( indices !== undefined ) {
 
 
@@ -312,7 +312,7 @@ THREE.Geometry.prototype = {
 
 
 		} else {
 		} else {
 
 
-			for ( var i = 0; i < vertices.length; i += 3 ) {
+			for ( var i = 0; i < positions.length / 3; i += 3 ) {
 
 
 				addFace( i, i + 1, i + 2 );
 				addFace( i, i + 1, i + 2 );