Перейти к основному содержанию

Class: ScreenPoints

Около 2 мин

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

NameTypeDescription
maxCount?numberMaximum points count. Can`t be changed after creation.
material?ScreenPointsMaterialPoint Material. If not specified, the default material will be used.

Returns

ScreenPoints

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

NameTypeDescription
color?ColorRepresentationDefault points color.
opacity?numberDefault points opacity.
size?numberDefault points size.

Returns

this


fromEdgesGeometry

fromEdgesGeometry(geometry): this

Writes point set data to a point memory array from edges geometry.

Parameters

NameTypeDescription
geometryEdgesGeometry<BufferGeometry<NormalBufferAttributes>>Geometry object.

Returns

this


fromLineSegments

fromLineSegments(lineSegments): this

Writes point set data to a point memory array from line segments object.

Parameters

NameTypeDescription
lineSegmentsLineSegments<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

NameTypeDescription
meshMesh<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

NameTypeDescription
pointsArrayLike<Vector3>Array of Vector3 objects.

Returns

this


fromWireframeGeometry

fromWireframeGeometry(geometry): this

Writes point set data to a point memory array from wireframe geometry.

Parameters

NameTypeDescription
geometryWireframeGeometry<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

NameTypeDescription
positionnumber[] | Vector3Point coordinates.
colorColorRepresentationPoint color.
opacity?numberPoint opacity.
size?numberPoint size.

Returns

this


setColorAtIndex

setColorAtIndex(index, color, opacity): this

Set point color at index.

Parameters

NameTypeDescription
indexnumberPoint index.
colorColorRepresentationPoint color.
opacitynumberPoint opacity.

Returns

this


setColors

setColors(array): this

Bach set point colors.

Parameters

NameTypeDescription
arrayFloat32Array | ArrayLike<number>Point colors array by color components (r,g,b,a).

Returns

this


setPointsCount

setPointsCount(count): void

Set visible points count.

Parameters

NameTypeDescription
countnumberPoints count.

Returns

void


setPositionAtIndex

setPositionAtIndex(index, position): this

Set point position at index.

Parameters

NameTypeDescription
indexnumberPoint index.
positionnumber[] | Vector3Point position.

Returns

this


setPositions

setPositions(array): this

Bach set point positions.

Parameters

NameTypeDescription
arrayFloat32Array | ArrayLike<number>Point positions array.

Returns

this


setSize

setSize(array): this

Bach set point sizes.

Parameters

NameTypeDescription
arrayFloat32Array | ArrayLike<number>Point sizes array.

Returns

this


setSizeAtIndex

setSizeAtIndex(index, size): this

Set point size at index.

Parameters

NameTypeDescription
indexnumberPoint index.
sizenumberPoint.size.

Returns

this