소스 검색

Updated examples.

Mr.doob 10 년 전
부모
커밋
626d79eb3d

+ 1 - 1
examples/js/geometries/TeapotBufferGeometry.js

@@ -721,7 +721,7 @@ THREE.TeapotBufferGeometry = function ( size, segments, bottom, lid, body, fitLi
 
 	}
 
-	this.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+	this.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 	this.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
 	this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
 	this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );

+ 1 - 1
examples/js/loaders/AWDLoader.js

@@ -764,7 +764,7 @@
 
 						buffer = new Uint16Array( str_len / 2 );
 						attrib = new THREE.BufferAttribute( buffer, 1 );
-						geom.addIndex( attrib );
+						geom.setIndex( attrib );
 
 						idx = 0;
 

+ 1 - 1
examples/js/loaders/BabylonLoader.js

@@ -87,7 +87,7 @@ THREE.BabylonLoader.prototype = {
 
 		var indices = new Uint16Array( json.indices );
 
-		geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+		geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 
 		// positions
 

+ 1 - 1
examples/js/loaders/UTF8Loader.js

@@ -94,7 +94,7 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
 
 	}
 
-	geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+	geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 	geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
 	geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
 	geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );

+ 1 - 1
examples/js/loaders/VTKLoader.js

@@ -101,7 +101,7 @@ THREE.VTKLoader.prototype = {
 		}
 
 		var geometry = new THREE.BufferGeometry();
-		geometry.addIndex( new THREE.BufferAttribute( new ( indices.length > 65535 ? Uint32Array : Uint16Array )( indices ), 1 ) );
+		geometry.setIndex( new THREE.BufferAttribute( new ( indices.length > 65535 ? Uint32Array : Uint16Array )( indices ), 1 ) );
 		geometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( positions ), 3 ) );
 
 		return geometry;

+ 1 - 1
examples/js/loaders/ctm/CTMLoader.js

@@ -238,7 +238,7 @@ THREE.CTMLoader.prototype.createModel = function ( file, callback ) {
 
 		}
 
-		this.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+		this.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 		this.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
 
 		if ( normals !== undefined ) {

+ 1 - 1
examples/js/loaders/sea3d/SEA3DLoader.js

@@ -1013,7 +1013,7 @@ THREE.SEA3D.prototype.readGeometryBuffer = function( sea ) {
 
 	}
 
-	geo.addIndex( new THREE.BufferAttribute( new Uint16Array( sea.indexes ), 1 ) );
+	geo.setIndex( new THREE.BufferAttribute( new Uint16Array( sea.indexes ), 1 ) );
 	geo.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( sea.vertex ), 3 ) );
 
 	if ( sea.uv ) {

+ 1 - 1
examples/webgl_buffergeometry_instancing_dynamic.html

@@ -208,7 +208,7 @@
 				22, 21, 23
 			] );
 
-			geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+			geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 
 			// per instance data
 			var offsets = new THREE.InstancedBufferAttribute( new Float32Array( instances * 3 ), 3, 1 );

+ 1 - 1
examples/webgl_buffergeometry_instancing_interleaved_dynamic.html

@@ -178,7 +178,7 @@
 			22, 21, 23
 		] );
 
-		geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+		geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 
 		// per instance data
 		instanceBuffer = new THREE.InstancedInterleavedBuffer( new Float32Array( instances * 8 ), 8, 1 ).setDynamic( true );

+ 1 - 1
examples/webgl_buffergeometry_lines_indexed.html

@@ -181,7 +181,7 @@
 				);
 				// --------------------------------
 
-				geometry.addIndex( new THREE.BufferAttribute( new Uint16Array( indices_array ), 1 ) );
+				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.computeBoundingSphere();

+ 1 - 1
examples/webgl_buffergeometry_uint.html

@@ -187,7 +187,7 @@
 
 				}
 
-				geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+				geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 				geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
 				geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
 				geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) );

+ 2 - 2
examples/webgl_interactive_raycasting_points.html

@@ -131,7 +131,7 @@
 
 				}
 
-				geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+				geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 
 				var material = new THREE.PointsMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
 				var pointcloud = new THREE.Points( geometry, material );
@@ -159,7 +159,7 @@
 
 				}
 
-				geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
+				geometry.setIndex( new THREE.BufferAttribute( indices, 1 ) );
 				geometry.addDrawCall( 0, indices.length );
 
 				var material = new THREE.PointsMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );