浏览代码

Examples: Simplify webgl_buffergeometry_lines_indexed

Mugen87 8 年之前
父节点
当前提交
61cad9b7e3
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      examples/webgl_buffergeometry_lines_indexed.html

+ 3 - 3
examples/webgl_buffergeometry_lines_indexed.html

@@ -181,9 +181,9 @@
 				);
 				// --------------------------------
 
-				geometry.setIndex( new THREE.BufferAttribute( new Uint16Array( indices_array ), 1 ) );
-				geometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( positions ), 3 ) );
-				geometry.addAttribute( 'color', new THREE.BufferAttribute( new Float32Array( colors ), 3 ) );
+				geometry.setIndex( indices_array );
+				geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );
+				geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
 				geometry.computeBoundingSphere();
 
 				mesh = new THREE.LineSegments( geometry, material );