Переглянути джерело

Fixed interactive buffergeometry example.

Mr.doob 11 роки тому
батько
коміт
ecbce0c70e
1 змінених файлів з 4 додано та 4 видалено
  1. 4 4
      examples/webgl_interactive_buffergeometry.html

+ 4 - 4
examples/webgl_interactive_buffergeometry.html

@@ -182,9 +182,9 @@
 
 				}
 
-				geometry.addAttribute( 'position', new THREE.Float32Attribute( positions, 3 ) );
-				geometry.addAttribute( 'normal', new THREE.Float32Attribute( normals, 3 ) );
-				geometry.addAttribute( 'color', new THREE.Float32Attribute( colors, 3 ) );
+				geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
+				geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
+				geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) );
 
 				geometry.computeBoundingSphere();
 
@@ -204,7 +204,7 @@
 				mouse = new THREE.Vector2();
 
 				var geometry = new THREE.BufferGeometry();
-				geometry.addAttribute( 'position', new THREE.Float32Attribute( 4 * 3, 3 ) );
+				geometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( 4 * 3 ), 3 ) );
 
 				var material = new THREE.LineBasicMaterial( { color: 0xffffff, linewidth: 2, transparent: true } );