Browse Source

Updated examples.

Mr.doob 10 years ago
parent
commit
9366cfc891

+ 11 - 11
examples/index.html

@@ -235,8 +235,8 @@
 				"webgl_interactive_cubes_ortho",
 				"webgl_interactive_draggablecubes",
 				"webgl_interactive_lines",
-				"webgl_interactive_particles",
-				"webgl_interactive_raycasting_pointcloud",
+				"webgl_interactive_points",
+				"webgl_interactive_raycasting_points",
 				"webgl_interactive_voxelpainter",
 				"webgl_kinect",
 				"webgl_lensflares",
@@ -330,14 +330,14 @@
 				"webgl_octree",
 				"webgl_octree_raycasting",
 				"webgl_panorama_equirectangular",
-				"webgl_particles_billboards",
-				"webgl_particles_billboards_colors",
-				"webgl_particles_dynamic",
-				"webgl_particles_random",
-				"webgl_particles_sprites",
 				"webgl_performance",
 				"webgl_performance_doublesided",
 				"webgl_performance_static",
+				"webgl_points_billboards",
+				"webgl_points_billboards_colors",
+				"webgl_points_dynamic",
+				"webgl_points_random",
+				"webgl_points_sprites",
 				"webgl_postprocessing",
 				"webgl_postprocessing_advanced",
 				"webgl_postprocessing_crossfade",
@@ -381,14 +381,14 @@
 				"webgl_buffergeometry_instancing_interleaved_dynamic",
 				"webgl_buffergeometry_lines",
 				"webgl_buffergeometry_lines_indexed",
-				"webgl_buffergeometry_particles",
+				"webgl_buffergeometry_points",
 				"webgl_buffergeometry_rawshader",
 				"webgl_buffergeometry_uint",
 				"webgl_custom_attributes",
 				"webgl_custom_attributes_lines",
-				"webgl_custom_attributes_particles",
-				"webgl_custom_attributes_particles2",
-				"webgl_custom_attributes_particles3"
+				"webgl_custom_attributes_points",
+				"webgl_custom_attributes_points2",
+				"webgl_custom_attributes_points3"
 			],
 			"vr": [
 				"vr_cubes",

+ 1 - 1
examples/js/GPUParticleSystem.js

@@ -370,7 +370,7 @@ THREE.GPUParticleContainer = function(maxParticles, particleSystem) {
   self.particleShaderMat = self.GPUParticleSystem.particleShaderMat;
 
   this.init = function() {
-    self.particleSystem = new THREE.PointCloud(self.particleShaderGeo, self.particleShaderMat);
+    self.particleSystem = new THREE.Points(self.particleShaderGeo, self.particleShaderMat);
     self.particleSystem.frustumCulled = false;
     this.add(self.particleSystem);
   };

+ 7 - 7
examples/misc_controls_fly.html

@@ -184,17 +184,17 @@
 
 				var stars;
 				var starsMaterials = [
-					new THREE.PointCloudMaterial( { color: 0x555555, size: 2, sizeAttenuation: false } ),
-					new THREE.PointCloudMaterial( { color: 0x555555, size: 1, sizeAttenuation: false } ),
-					new THREE.PointCloudMaterial( { color: 0x333333, size: 2, sizeAttenuation: false } ),
-					new THREE.PointCloudMaterial( { color: 0x3a3a3a, size: 1, sizeAttenuation: false } ),
-					new THREE.PointCloudMaterial( { color: 0x1a1a1a, size: 2, sizeAttenuation: false } ),
-					new THREE.PointCloudMaterial( { color: 0x1a1a1a, size: 1, sizeAttenuation: false } )
+					new THREE.PointsMaterial( { color: 0x555555, size: 2, sizeAttenuation: false } ),
+					new THREE.PointsMaterial( { color: 0x555555, size: 1, sizeAttenuation: false } ),
+					new THREE.PointsMaterial( { color: 0x333333, size: 2, sizeAttenuation: false } ),
+					new THREE.PointsMaterial( { color: 0x3a3a3a, size: 1, sizeAttenuation: false } ),
+					new THREE.PointsMaterial( { color: 0x1a1a1a, size: 2, sizeAttenuation: false } ),
+					new THREE.PointsMaterial( { color: 0x1a1a1a, size: 1, sizeAttenuation: false } )
 				];
 
 				for ( i = 10; i < 30; i ++ ) {
 
-					stars = new THREE.PointCloud( starsGeometry[ i % 2 ], starsMaterials[ i % 6 ] );
+					stars = new THREE.Points( starsGeometry[ i % 2 ], starsMaterials[ i % 6 ] );
 
 					stars.rotation.x = Math.random() * 6;
 					stars.rotation.y = Math.random() * 6;

+ 1 - 1
examples/webgl_buffergeometry_custom_attributes_particles.html

@@ -148,7 +148,7 @@
 			geometry.addAttribute( 'customColor', new THREE.BufferAttribute( colors, 3 ) );
 			geometry.addAttribute( 'size', new THREE.BufferAttribute( sizes, 1 ) );
 
-			particleSystem = new THREE.PointCloud( geometry, shaderMaterial );
+			particleSystem = new THREE.Points( geometry, shaderMaterial );
 
 			scene.add( particleSystem );
 

+ 2 - 2
examples/webgl_buffergeometry_drawcalls.html

@@ -117,7 +117,7 @@
 				positions = new Float32Array( segments * 3 );
 				colors = new Float32Array( segments * 3 );
 
-				var pMaterial = new THREE.PointCloudMaterial( {
+				var pMaterial = new THREE.PointsMaterial( {
 					color: 0xFFFFFF,
 					size: 3,
 					blending: THREE.AdditiveBlending,
@@ -150,7 +150,7 @@
 				particles.addAttribute( 'position', new THREE.BufferAttribute( particlePositions, 3 ).setDynamic( true ) );
 
 				// create the particle system
-				pointCloud = new THREE.PointCloud( particles, new THREE.MultiMaterial( [ pMaterial ] ) );
+				pointCloud = new THREE.Points( particles, new THREE.MultiMaterial( [ pMaterial ] ) );
 				group.add( pointCloud );
 
 				var geometry = new THREE.BufferGeometry();

+ 2 - 2
examples/webgl_buffergeometry_particles.html → examples/webgl_buffergeometry_points.html

@@ -108,9 +108,9 @@
 
 				//
 
-				var material = new THREE.PointCloudMaterial( { size: 15, vertexColors: THREE.VertexColors } );
+				var material = new THREE.PointsMaterial( { size: 15, vertexColors: THREE.VertexColors } );
 
-				particleSystem = new THREE.PointCloud( geometry, material );
+				particleSystem = new THREE.Points( geometry, material );
 				scene.add( particleSystem );
 
 				//

+ 1 - 1
examples/webgl_camera.html

@@ -137,7 +137,7 @@
 
 				}
 
-				var particles = new THREE.PointCloud( geometry, new THREE.PointCloudMaterial( { color: 0x888888 } ) );
+				var particles = new THREE.Points( geometry, new THREE.PointsMaterial( { color: 0x888888 } ) );
 				scene.add( particles );
 
 				//

+ 1 - 1
examples/webgl_custom_attributes_particles.html → examples/webgl_custom_attributes_points.html

@@ -157,7 +157,7 @@
 
 			//
 
-			sphere = new THREE.PointCloud( geometry, material );
+			sphere = new THREE.Points( geometry, material );
 			scene.add( sphere );
 
 			//

+ 1 - 1
examples/webgl_custom_attributes_particles2.html → examples/webgl_custom_attributes_points2.html

@@ -160,7 +160,7 @@
 
 			//
 
-			sphere = new THREE.PointCloud( geometry, material );
+			sphere = new THREE.Points( geometry, material );
 			scene.add( sphere );
 
 			//

+ 1 - 1
examples/webgl_custom_attributes_particles3.html → examples/webgl_custom_attributes_points3.html

@@ -228,7 +228,7 @@
 
 			//
 
-			object = new THREE.PointCloud( geometry, material );
+			object = new THREE.Points( geometry, material );
 			scene.add( object );
 
 			//

+ 2 - 2
examples/webgl_geometry_shapes.html

@@ -115,7 +115,7 @@
 					// vertices from real points
 
 					var pgeo = points.clone();
-					var particles = new THREE.PointCloud( pgeo, new THREE.PointCloudMaterial( { color: color, size: 4 } ) );
+					var particles = new THREE.Points( pgeo, new THREE.PointsMaterial( { color: color, size: 4 } ) );
 					particles.position.set( x, y, z + 25 );
 					particles.rotation.set( rx, ry, rz );
 					particles.scale.set( s, s, s );
@@ -132,7 +132,7 @@
 					// equidistance sampled points
 
 					var pgeo = spacedPoints.clone();
-					var particles2 = new THREE.PointCloud( pgeo, new THREE.PointCloudMaterial( { color: color, size: 4 } ) );
+					var particles2 = new THREE.Points( pgeo, new THREE.PointsMaterial( { color: color, size: 4 } ) );
 					particles2.position.set( x, y, z + 125 );
 					particles2.rotation.set( rx, ry, rz );
 					particles2.scale.set( s, s, s );

+ 1 - 1
examples/webgl_interactive_particles.html → examples/webgl_interactive_points.html

@@ -148,7 +148,7 @@
 
 				//
 
-				particles = new THREE.PointCloud( geometry, material );
+				particles = new THREE.Points( geometry, material );
 				scene.add( particles );
 
 				//

+ 8 - 8
examples/webgl_interactive_raycasting_pointcloud.html → examples/webgl_interactive_raycasting_points.html

@@ -105,8 +105,8 @@
 
 				var geometry = generatePointCloudGeometry( color, width, length );
 
-				var material = new THREE.PointCloudMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
-				var pointcloud = new THREE.PointCloud( geometry, material );
+				var material = new THREE.PointsMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
+				var pointcloud = new THREE.Points( geometry, material );
 
 				return pointcloud;
 
@@ -133,8 +133,8 @@
 
 				geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
 
-				var material = new THREE.PointCloudMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
-				var pointcloud = new THREE.PointCloud( geometry, material );
+				var material = new THREE.PointsMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
+				var pointcloud = new THREE.Points( geometry, material );
 
 				return pointcloud;
 
@@ -162,8 +162,8 @@
 				geometry.addIndex( new THREE.BufferAttribute( indices, 1 ) );
 				geometry.addDrawCall( 0, indices.length );
 
-				var material = new THREE.PointCloudMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
-				var pointcloud = new THREE.PointCloud( geometry, material );
+				var material = new THREE.PointsMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
+				var pointcloud = new THREE.Points( geometry, material );
 
 				return pointcloud;
 
@@ -205,8 +205,8 @@
 				geometry.colors = colors;
 				geometry.computeBoundingBox();
 
-				var material = new THREE.PointCloudMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
-				var pointcloud = new THREE.PointCloud( geometry, material );
+				var material = new THREE.PointsMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
+				var pointcloud = new THREE.Points( geometry, material );
 
 				return pointcloud;
 

+ 1 - 1
examples/webgl_kinect.html

@@ -185,7 +185,7 @@
 
 					} );
 
-					mesh = new THREE.PointCloud( geometry, material );
+					mesh = new THREE.Points( geometry, material );
 					scene.add( mesh );
 
 					var gui = new dat.GUI();

+ 1 - 1
examples/webgl_nearestneighbour.html

@@ -144,7 +144,7 @@
 				_particleGeom.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
 				_particleGeom.addAttribute( 'alpha', new THREE.BufferAttribute( alphas, 1 ) );
 
-				particles = new THREE.PointCloud( _particleGeom, pointShaderMaterial );
+				particles = new THREE.Points( _particleGeom, pointShaderMaterial );
 
 				for (var x = 0; x < amountOfParticles; x++) {
 					positions[ x * 3 + 0 ] = Math.random() * 1000;

+ 2 - 2
examples/webgl_particles_billboards.html → examples/webgl_points_billboards.html

@@ -81,10 +81,10 @@
 
 				}
 
-				material = new THREE.PointCloudMaterial( { size: 35, sizeAttenuation: false, map: sprite, alphaTest: 0.5, transparent: true } );
+				material = new THREE.PointsMaterial( { size: 35, sizeAttenuation: false, map: sprite, alphaTest: 0.5, transparent: true } );
 				material.color.setHSL( 1.0, 0.3, 0.7 );
 
-				particles = new THREE.PointCloud( geometry, material );
+				particles = new THREE.Points( geometry, material );
 				scene.add( particles );
 
 				//

+ 2 - 2
examples/webgl_particles_billboards_colors.html → examples/webgl_points_billboards_colors.html

@@ -86,10 +86,10 @@
 
 				geometry.colors = colors;
 
-				material = new THREE.PointCloudMaterial( { size: 85, map: sprite, vertexColors: THREE.VertexColors, alphaTest: 0.5, transparent: true } );
+				material = new THREE.PointsMaterial( { size: 85, map: sprite, vertexColors: THREE.VertexColors, alphaTest: 0.5, transparent: true } );
 				material.color.setHSL( 1.0, 0.2, 0.7 );
 
-				particles = new THREE.PointCloud( geometry, material );
+				particles = new THREE.Points( geometry, material );
 				scene.add( particles );
 
 				//

+ 3 - 3
examples/webgl_particles_dynamic.html → examples/webgl_points_dynamic.html

@@ -146,7 +146,7 @@
 				parent = new THREE.Object3D();
 				scene.add( parent );
 
-				var grid = new THREE.PointCloud( new THREE.PlaneBufferGeometry( 15000, 15000, 64, 64 ), new THREE.PointCloudMaterial( { color: 0xff0000, size: 10 } ) );
+				var grid = new THREE.Points( new THREE.PlaneBufferGeometry( 15000, 15000, 64, 64 ), new THREE.PointsMaterial( { color: 0xff0000, size: 10 } ) );
 				grid.position.y = -400;
 				grid.rotation.x = - Math.PI / 2;
 				parent.add( grid );
@@ -236,7 +236,7 @@
 
 						c = ( i < clones.length -1 ) ? 0x252525 : color;
 
-						mesh = new THREE.PointCloud( geometry, new THREE.PointCloudMaterial( { size: 3, color: c } ) );
+						mesh = new THREE.Points( geometry, new THREE.PointsMaterial( { size: 3, color: c } ) );
 						mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
 
 						mesh.position.x = x + clones[ i ][ 0 ];
@@ -251,7 +251,7 @@
 
 				} else {
 
-					mesh = new THREE.PointCloud( geometry, new THREE.PointCloudMaterial( { size: 3, color: color } ) );
+					mesh = new THREE.Points( geometry, new THREE.PointsMaterial( { size: 3, color: color } ) );
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
 
 					mesh.position.x = x;

+ 3 - 3
examples/webgl_particles_random.html → examples/webgl_points_random.html

@@ -92,9 +92,9 @@
 					color = parameters[i][0];
 					size  = parameters[i][1];
 
-					materials[i] = new THREE.PointCloudMaterial( { size: size } );
+					materials[i] = new THREE.PointsMaterial( { size: size } );
 
-					particles = new THREE.PointCloud( geometry, materials[i] );
+					particles = new THREE.Points( geometry, materials[i] );
 
 					particles.rotation.x = Math.random() * 6;
 					particles.rotation.y = Math.random() * 6;
@@ -193,7 +193,7 @@
 
 					var object = scene.children[ i ];
 
-					if ( object instanceof THREE.PointCloud ) {
+					if ( object instanceof THREE.Points ) {
 
 						object.rotation.y = time * ( i < 4 ? i + 1 : - ( i + 1 ) );
 

+ 3 - 3
examples/webgl_particles_sprites.html → examples/webgl_points_sprites.html

@@ -100,10 +100,10 @@
 					sprite = parameters[i][1];
 					size   = parameters[i][2];
 
-					materials[i] = new THREE.PointCloudMaterial( { size: size, map: sprite, blending: THREE.AdditiveBlending, depthTest: false, transparent : true } );
+					materials[i] = new THREE.PointsMaterial( { size: size, map: sprite, blending: THREE.AdditiveBlending, depthTest: false, transparent : true } );
 					materials[i].color.setHSL( color[0], color[1], color[2] );
 
-					particles = new THREE.PointCloud( geometry, materials[i] );
+					particles = new THREE.Points( geometry, materials[i] );
 
 					particles.rotation.x = Math.random() * 6;
 					particles.rotation.y = Math.random() * 6;
@@ -202,7 +202,7 @@
 
 					var object = scene.children[ i ];
 
-					if ( object instanceof THREE.PointCloud ) {
+					if ( object instanceof THREE.Points ) {
 
 						object.rotation.y = time * ( i < 4 ? i + 1 : - ( i + 1 ) );
 

+ 2 - 2
examples/webgl_trails.html

@@ -59,9 +59,9 @@
 
 				}
 
-				var material = new THREE.PointCloudMaterial( { size: 1, vertexColors: THREE. VertexColors, depthTest: false, opacity: 0.5, sizeAttenuation: false, transparent: true } );
+				var material = new THREE.PointsMaterial( { size: 1, vertexColors: THREE. VertexColors, depthTest: false, opacity: 0.5, sizeAttenuation: false, transparent: true } );
 
-				var mesh = new THREE.PointCloud( geometry, material );
+				var mesh = new THREE.Points( geometry, material );
 				scene.add( mesh );
 
 				renderer = new THREE.WebGLRenderer( { preserveDrawingBuffer: true } );