Class: ScreenPoints
Class: ScreenPoints
Represents one or more points that can have different color, size, screen scaling. Has high rendering performance.
Extends
Object3D
Constructors
Constructor
new ScreenPoints(
maxCount
?,material
?):ScreenPoints
Parameters
maxCount?
number
Maximum points count. Can`t be changed after creation.
material?
Point Material. If not specified, the default material will be used.
Returns
ScreenPoints
Overrides
Object3D.constructor
Properties
geometry
geometry:
BufferGeometry
Screen points geometry.
material
material:
ScreenPointsMaterial
Screen points material.
maxCount
readonly
maxCount:any
Maximum points count. Set when creating an instance of the class.
type
type:
string
A Read-only string to check this
object type.
Remarks
This can be used to find a specific type of Object3D in a scene. Sub-classes will update this value.
Default Value
Object3D
Overrides
Object3D.type
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
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
geometry
EdgesGeometry
Geometry object.
Returns
this
fromLineSegments()
fromLineSegments(
lineSegments
):this
Writes point set data to a point memory array from line segments object.
Parameters
lineSegments
LineSegments
Line segments object.
Returns
this
fromMesh()
fromMesh(
mesh
):this
Writes point set data to a point memory array from mesh object.
Parameters
mesh
Mesh
Mesh object.
Returns
this
fromPoints()
fromPoints(
points
):this
Writes point set data to a point memory array of points from points array.
Parameters
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
geometry
WireframeGeometry
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
position
Point coordinates.
number
[] | Vector3
color
ColorRepresentation
Point color.
opacity?
number
Point opacity.
size?
number
Point size.
Returns
this
raycast()
raycast(
raycaster
,intersects
):void
Abstract (empty) method to get intersections between a casted ray and this object
Parameters
raycaster
Raycaster
intersects
any
[]
Returns
void
Remarks
Subclasses such as THREE.Mesh | Mesh, THREE.Line | Line, and THREE.Points | Points implement this method in order to use raycasting.
See
THREE.Raycaster | Raycaster
Default Value
() => {}
Overrides
Object3D.raycast
setColorAtIndex()
setColorAtIndex(
index
,color
,opacity
):this
Set point color at index.
Parameters
index
number
Point index.
color
ColorRepresentation
Point color.
opacity
number
Point opacity.
Returns
this
setColors()
setColors(
array
):this
Bach set point colors.
Parameters
array
Point colors array by color components (r,g,b,a).
ArrayLike
<number
> | Float32Array
<ArrayBufferLike
>
Returns
this
setPointsCount()
setPointsCount(
count
):void
Set visible points count.
Parameters
count
number
Points count.
Returns
void
setPositionAtIndex()
setPositionAtIndex(
index
,position
):this
Set point position at index.
Parameters
index
number
Point index.
position
Point position.
number
[] | Vector3
Returns
this
setPositions()
setPositions(
array
):this
Bach set point positions.
Parameters
array
Point positions array.
ArrayLike
<number
> | Float32Array
<ArrayBufferLike
>
Returns
this
setSize()
setSize(
array
):this
Bach set point sizes.
Parameters
array
Point sizes array.
ArrayLike
<number
> | Float32Array
<ArrayBufferLike
>
Returns
this
setSizeAtIndex()
setSizeAtIndex(
index
,size
):this
Set point size at index.
Parameters
index
number
Point index.
size
number
Point.size.
Returns
this