提交 3a1b527a 编写于 作者: M Mr.doob

ParticleSystem* to PointCloud*

Actually, I wonder if it should be Pointcloud and PointcloudMaterial instead (lowercase c)?
/ping @WestLangley
上级 94125d9e
......@@ -61,7 +61,7 @@
<h3>.[page:Array colors]</h3>
<div>
Array of vertex [page:Color colors], matching number and order of vertices.<br />
Used in [page:ParticleSystem] and [page:Line].<br />
Used in [page:PointCloud] and [page:Line].<br />
[page:Mesh Meshes] use per-face-use-of-vertex colors embedded directly in faces.<br />
To signal an update in this array, [page:Geometry Geometry.colorsNeedUpdate] needs to be set to true.
</div>
......
......@@ -11,7 +11,7 @@
<h1>[name]</h1>
<div class="desc">The default material used by [page:ParticleSystem particle] systems.</div>
<div class="desc">The default material used by [page:PointCloud particle] systems.</div>
<h2>Constructor</h2>
......
......@@ -32,7 +32,7 @@
<h3>.[page:Material material]</h3>
<div>An instance of [page:Material], defining the object's appearance. Default is a [page:ParticleSystemMaterial] with randomised colour.</div>
<div>An instance of [page:Material], defining the object's appearance. Default is a [page:PointCloudMaterial] with randomised colour.</div>
<h3>.[page:Boolean frustrumCulled]</h3>
......
......@@ -68,7 +68,7 @@ var list = {
[ "MeshLambertMaterial", "api/materials/MeshLambertMaterial" ],
[ "MeshNormalMaterial", "api/materials/MeshNormalMaterial" ],
[ "MeshPhongMaterial", "api/materials/MeshPhongMaterial" ],
[ "ParticleSystemMaterial", "api/materials/ParticleSystemMaterial" ],
[ "PointCloudMaterial", "api/materials/PointCloudMaterial" ],
[ "RawShaderMaterial", "api/materials/RawShaderMaterial" ],
[ "ShaderMaterial", "api/materials/ShaderMaterial" ],
[ "SpriteCanvasMaterial", "api/materials/SpriteCanvasMaterial" ],
......@@ -102,7 +102,7 @@ var list = {
[ "LOD", "api/objects/LOD" ],
[ "Mesh", "api/objects/Mesh" ],
[ "MorphAnimMesh", "api/objects/MorphAnimMesh" ],
[ "ParticleSystem", "api/objects/ParticleSystem" ],
[ "PointCloud", "api/objects/PointCloud" ],
[ "SkinnedMesh", "api/objects/SkinnedMesh" ],
[ "Sprite", "api/objects/Sprite" ]
],
......
......@@ -387,7 +387,7 @@ Editor.prototype = {
'MeshLambertMaterial': THREE.MeshLambertMaterial,
'MeshNormalMaterial': THREE.MeshNormalMaterial,
'MeshPhongMaterial': THREE.MeshPhongMaterial,
'ParticleSystemMaterial': THREE.ParticleSystemMaterial,
'PointCloudMaterial': THREE.PointCloudMaterial,
'ShaderMaterial': THREE.ShaderMaterial,
'SpriteCanvasMaterial': THREE.SpriteCanvasMaterial,
'SpriteMaterial': THREE.SpriteMaterial,
......
......@@ -12,7 +12,7 @@ Sidebar.Material = function ( editor ) {
'MeshLambertMaterial': THREE.MeshLambertMaterial,
'MeshNormalMaterial': THREE.MeshNormalMaterial,
'MeshPhongMaterial': THREE.MeshPhongMaterial,
'ParticleSystemMaterial': THREE.ParticleSystemMaterial,
'PointCloudMaterial': THREE.PointCloudMaterial,
'ShaderMaterial': THREE.ShaderMaterial,
'SpriteMaterial': THREE.SpriteMaterial,
'SpriteCanvasMaterial': THREE.SpriteCanvasMaterial,
......
......@@ -249,7 +249,7 @@ THREE.PathControls = function ( object, domElement ) {
particleGeo = createSplineGeometry( spline, 10 ),
lineMat = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 3 } ),
lineObj = new THREE.Line( lineGeo, lineMat ),
particleObj = new THREE.ParticleSystem( particleGeo, new THREE.ParticleSystemMaterial( { color: 0xffaa00, size: 3 } ) );
particleObj = new THREE.PointCloud( particleGeo, new THREE.PointCloudMaterial( { color: 0xffaa00, size: 3 } ) );
lineObj.scale.set( 1, 1, 1 );
parent.add( lineObj );
......
......@@ -206,17 +206,17 @@
var stars;
var starsMaterials = [
new THREE.ParticleSystemMaterial( { color: 0x555555, size: 2, sizeAttenuation: false } ),
new THREE.ParticleSystemMaterial( { color: 0x555555, size: 1, sizeAttenuation: false } ),
new THREE.ParticleSystemMaterial( { color: 0x333333, size: 2, sizeAttenuation: false } ),
new THREE.ParticleSystemMaterial( { color: 0x3a3a3a, size: 1, sizeAttenuation: false } ),
new THREE.ParticleSystemMaterial( { color: 0x1a1a1a, size: 2, sizeAttenuation: false } ),
new THREE.ParticleSystemMaterial( { color: 0x1a1a1a, size: 1, sizeAttenuation: false } )
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 } )
];
for ( i = 10; i < 30; i ++ ) {
stars = new THREE.ParticleSystem( starsGeometry[ i % 2 ], starsMaterials[ i % 6 ] );
stars = new THREE.PointCloud( starsGeometry[ i % 2 ], starsMaterials[ i % 6 ] );
stars.rotation.x = Math.random() * 6;
stars.rotation.y = Math.random() * 6;
......
......@@ -157,7 +157,7 @@
positions = _particleGeom.attributes.position.array;
alphas = _particleGeom.attributes.alpha.array;
particles = new THREE.ParticleSystem( _particleGeom, pointShaderMaterial );
particles = new THREE.PointCloud( _particleGeom, pointShaderMaterial );
particles.dynamic = true;
for (var x = 0; x < amountOfParticles; x++) {
......@@ -242,4 +242,4 @@
animate();
</script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -81,10 +81,10 @@
}
material = new THREE.ParticleSystemMaterial( { size: 35, sizeAttenuation: false, map: sprite, transparent: true } );
material = new THREE.PointCloudMaterial( { size: 35, sizeAttenuation: false, map: sprite, transparent: true } );
material.color.setHSL( 1.0, 0.3, 0.7 );
particles = new THREE.ParticleSystem( geometry, material );
particles = new THREE.PointCloud( geometry, material );
particles.sortParticles = true;
scene.add( particles );
......
......@@ -86,10 +86,10 @@
geometry.colors = colors;
material = new THREE.ParticleSystemMaterial( { size: 85, map: sprite, vertexColors: true, transparent: true } );
material = new THREE.PointCloudMaterial( { size: 85, map: sprite, vertexColors: true, transparent: true } );
material.color.setHSL( 1.0, 0.2, 0.7 );
particles = new THREE.ParticleSystem( geometry, material );
particles = new THREE.PointCloud( geometry, material );
particles.sortParticles = true;
scene.add( particles );
......
......@@ -152,7 +152,7 @@
parent = new THREE.Object3D();
scene.add( parent );
var grid = new THREE.ParticleSystem( new THREE.PlaneGeometry( 15000, 15000, 64, 64 ), new THREE.ParticleSystemMaterial( { color: 0xff0000, size: 10 } ) );
var grid = new THREE.PointCloud( new THREE.PlaneGeometry( 15000, 15000, 64, 64 ), new THREE.PointCloudMaterial( { color: 0xff0000, size: 10 } ) );
grid.position.y = -400;
grid.rotation.x = - Math.PI / 2;
parent.add( grid );
......@@ -245,7 +245,7 @@
c = ( i < clones.length -1 ) ? 0x252525 : color;
mesh = new THREE.ParticleSystem( geometry, new THREE.ParticleSystemMaterial( { size: 3, color: c } ) );
mesh = new THREE.PointCloud( geometry, new THREE.PointCloudMaterial( { size: 3, color: c } ) );
mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
mesh.position.x = x + clones[ i ][ 0 ];
......@@ -263,7 +263,7 @@
} else {
mesh = new THREE.ParticleSystem( geometry, new THREE.ParticleSystemMaterial( { size: 3, color: color } ) );
mesh = new THREE.PointCloud( geometry, new THREE.PointCloudMaterial( { size: 3, color: color } ) );
mesh.scale.x = mesh.scale.y = mesh.scale.z = scale;
mesh.position.x = x;
......
......@@ -92,9 +92,9 @@
color = parameters[i][0];
size = parameters[i][1];
materials[i] = new THREE.ParticleSystemMaterial( { size: size } );
materials[i] = new THREE.PointCloudMaterial( { size: size } );
particles = new THREE.ParticleSystem( geometry, materials[i] );
particles = new THREE.PointCloud( geometry, materials[i] );
particles.rotation.x = Math.random() * 6;
particles.rotation.y = Math.random() * 6;
......@@ -192,7 +192,7 @@
var object = scene.children[ i ];
if ( object instanceof THREE.ParticleSystem ) {
if ( object instanceof THREE.PointCloud ) {
object.rotation.y = time * ( i < 4 ? i + 1 : - ( i + 1 ) );
......
......@@ -343,7 +343,7 @@
});
particleCloud = new THREE.ParticleSystem( particles, shaderMaterial );
particleCloud = new THREE.PointCloud( particles, shaderMaterial );
particleCloud.dynamic = true;
// particleCloud.sortParticles = true;
......
......@@ -64,9 +64,9 @@
}
var material = new THREE.ParticleSystemMaterial( { size: 1, vertexColors: THREE. VertexColors, depthTest: false, opacity: 0.5, sizeAttenuation: false, transparent: true } );
var material = new THREE.PointCloudMaterial( { size: 1, vertexColors: THREE. VertexColors, depthTest: false, opacity: 0.5, sizeAttenuation: false, transparent: true } );
var mesh = new THREE.ParticleSystem( geometry, material );
var mesh = new THREE.PointCloud( geometry, material );
scene.add( mesh );
renderer = new THREE.WebGLRenderer( { preserveDrawingBuffer: true } );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册