Capítulo 87 de 859
A material for rendering point primitives.
Materials define the appearance of renderable 3D objects.
const vertices = [];
for ( let i = 0; i < 10000; i ++ ) {
const x = THREE.MathUtils.randFloatSpread( 2000 );
const y = THREE.MathUtils.randFloatSpread( 2000 );
const z = THREE.MathUtils.randFloatSpread( 2000 );
vertices.push( x, y, z );
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
const material = new THREE.PointsMaterial( { color: 0x888888 } );
const points = new THREE.Points( geometry, material );
scene.add( points );
Constructor
| Signature |
|---|
new PointsMaterial( parameters : Object ) |
Properties
| Property | Description |
|---|---|
.alphaMap : Texture | The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque). |
.color : Color | Color of the material. |
.fog : boolean | Whether the material is affected by fog or not. |
.isPointsMaterial : boolean (readonly) | This flag can be used for type testing. |
.map : Texture | The color map. May optionally include an alpha channel, typically combined with Material#transparent or Material#alphaTest. The texture map col… |
.size : number | Defines the size of the points in pixels. |
.sizeAttenuation : boolean | Specifies whether size of individual points is attenuated by the camera depth (perspective camera only). |