Class: ScreenPoints
Class: ScreenPoints
Represents one or more points that can have different color, size, screen scaling. Has high rendering performance.
Hierarchy
Object3D
↳
ScreenPoints
Constructors
constructor
• new ScreenPoints(maxCount?
, material?
): ScreenPoints
Parameters
Name | Type | Description |
---|---|---|
maxCount? | number | Maximum points count. Can`t be changed after creation. |
material? | ScreenPointsMaterial | Point Material. If not specified, the default material will be used. |
Returns
Overrides
Object3D.constructor
Properties
geometry
• geometry: BufferGeometry
<NormalBufferAttributes
>
Screen points geometry.
material
• material: ScreenPointsMaterial
Screen points material.
maxCount
• Readonly
maxCount: number
Maximum points count. Set when creating an instance of the class.
Methods
fill
▸ fill(color?
, opacity?
, size?
): this
Fills the memory array for the points declared at creation with the default parameters [color, opacity, size].
Parameters
Name | Type | Description |
---|---|---|
color? | ColorRepresentation | Default points color. |
opacity? | number | Default points opacity. |
size? | number | Default points size. |
Returns
this
fromEdgesGeometry
▸ fromEdgesGeometry(geometry
): this
Writes point set data to a point memory array from edges geometry.
Parameters
Name | Type | Description |
---|---|---|
geometry | EdgesGeometry <BufferGeometry <NormalBufferAttributes >> | Geometry object. |
Returns
this
fromLineSegments
▸ fromLineSegments(lineSegments
): this
Writes point set data to a point memory array from line segments object.
Parameters
Name | Type | Description |
---|---|---|
lineSegments | LineSegments <BufferGeometry <NormalBufferAttributes >, Material | Material [], Object3DEventMap > | Line segments object. |
Returns
this
fromMesh
▸ fromMesh(mesh
): this
Writes point set data to a point memory array from mesh object.
Parameters
Name | Type | Description |
---|---|---|
mesh | Mesh <BufferGeometry <NormalBufferAttributes >, Material | Material [], Object3DEventMap > | Mesh object. |
Returns
this
fromPoints
▸ fromPoints(points
): this
Writes point set data to a point memory array of points from points array.
Parameters
Name | Type | Description |
---|---|---|
points | ArrayLike <Vector3 > | Array of Vector3 objects. |
Returns
this
fromWireframeGeometry
▸ fromWireframeGeometry(geometry
): this
Writes point set data to a point memory array from wireframe geometry.
Parameters
Name | Type | Description |
---|---|---|
geometry | WireframeGeometry <BufferGeometry <NormalBufferAttributes >> | Geometry object. |
Returns
this
getPointsCount
▸ getPointsCount(): number
Get visible points count.
Returns
number
push
▸ push(position
, color
, opacity?
, size?
): this
Writes the new point data to the point memory array.
Parameters
Name | Type | Description |
---|---|---|
position | number [] | Vector3 | Point coordinates. |
color | ColorRepresentation | Point color. |
opacity? | number | Point opacity. |
size? | number | Point size. |
Returns
this
setColorAtIndex
▸ setColorAtIndex(index
, color
, opacity
): this
Set point color at index.
Parameters
Name | Type | Description |
---|---|---|
index | number | Point index. |
color | ColorRepresentation | Point color. |
opacity | number | Point opacity. |
Returns
this
setColors
▸ setColors(array
): this
Bach set point colors.
Parameters
Name | Type | Description |
---|---|---|
array | Float32Array | ArrayLike <number > | Point colors array by color components (r,g,b,a). |
Returns
this
setPointsCount
▸ setPointsCount(count
): void
Set visible points count.
Parameters
Name | Type | Description |
---|---|---|
count | number | Points count. |
Returns
void
setPositionAtIndex
▸ setPositionAtIndex(index
, position
): this
Set point position at index.
Parameters
Name | Type | Description |
---|---|---|
index | number | Point index. |
position | number [] | Vector3 | Point position. |
Returns
this
setPositions
▸ setPositions(array
): this
Bach set point positions.
Parameters
Name | Type | Description |
---|---|---|
array | Float32Array | ArrayLike <number > | Point positions array. |
Returns
this
setSize
▸ setSize(array
): this
Bach set point sizes.
Parameters
Name | Type | Description |
---|---|---|
array | Float32Array | ArrayLike <number > | Point sizes array. |
Returns
this
setSizeAtIndex
▸ setSizeAtIndex(index
, size
): this
Set point size at index.
Parameters
Name | Type | Description |
---|---|---|
index | number | Point index. |
size | number | Point.size. |
Returns
this