new Pointset() → {Pointset}
Provides an object which stores points and provides method which controls its position.
This is created when a valid json file containing point is read into a Zinc.Scene
object.
Points are rendered as an instanced mesh - every point is one instance of a
small quad billboarded towards the camera and kept at a constant size in
pixels on the GPU. Time varying vertex colour and morph vertex positions
are supported by blending between per time step position/colour arrays on
the CPU and writing the result into the instance attributes every frame.
- Source:
Returns:
- Type
- Pointset
Methods
addPoints(coords, labels, colour)
Add points to existing mesh if it exists, otherwise
create a new one and add to it.
Parameters:
| Name | Type | Description |
|---|---|---|
coords |
Array | An array of three components coordinates. |
labels |
Array | String | An array of strings, these are only added if the number of coords equals to the number labels provided. |
colour |
Number | A hex value of the colour for the points |
- Source:
createMesh(geometryIn, materialIn, options)
Create the pointset using geometry and material.
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
geometryIn |
THREE.Geomtry | Geometry of points to be rendered. | |||||||||
materialIn |
THREE.Material | Material to be set for the points, only its colour/opacity/alphaTest are used. | |||||||||
options |
Object | Provide various options
Properties
|
- Source:
deleteVertices()
Delete a vertex in index.
- Source:
displayLabels(flag)
Set visibility of Labels
Parameters:
| Name | Type | Description |
|---|---|---|
flag |
boolean | default value is true |
- Source:
editVertices()
Edit Vertice in index.
- Source:
getBoundingBox() → {THREE.Box3}
Get the bounding box for the whole set of points.
- Source:
Returns:
- Type
- THREE.Box3
getClosestVertex()
Get the closest vertex to centroid.
- Source:
getClosestVertexIndex()
Get the index of the closest vertex to centroid.
- Source:
getVerticesByIndex()
Get vertices at index
- Source:
isTimeVarying() → {Boolean}
Check if the pointset is time varying.
- Source:
Returns:
- Type
- Boolean
render()
Update the geometry and colours depending on the internal time and
refresh the marker/LOD state for the render.
- Source:
setColour(colour)
Set the colour of the pointset and its label
Parameters:
| Name | Type | Description |
|---|---|---|
colour |
THREE.Color | colour to be set |
- Source:
setColourHex(hex)
Set the colour of the pointset and its label using the hex value
Parameters:
| Name | Type | Description |
|---|---|---|
hex |
Number | hex value of color to be set |
- Source:
setLabelDepthTest(flag)
Turn size attenuation on/off based on the flag.
Parameters:
| Name | Type | Description |
|---|---|---|
flag |
Boolean | Determin either size attenuation should be on or off. |
- Source:
setLabelFontWeight(fontWeightIn)
Turn size attenuation on/off based on the flag.
Parameters:
| Name | Type | Description |
|---|---|---|
fontWeightIn |
Number | Default value is 700 |
- Source:
setLabelSize(size)
Set the size of the label
Parameters:
| Name | Type | Description |
|---|---|---|
size |
Number | Size to set, default value is 1. |
- Source:
setMesh()
Adapt a plain THREE.Points object (e.g. one parsed from a GLTF file)
into this Pointset's instanced mesh representation.
- Source:
setMorphTime(time)
Set the local time of this pointset.
Parameters:
| Name | Type | Description |
|---|---|---|
time |
Number | Can be any value between 0 to duration. |
- Source:
setName(groupNameIn)
Set the name for this ZincObject.
Parameters:
| Name | Type | Description |
|---|---|---|
groupNameIn |
String | Name to be set. |
- Source:
setSize(size)
Set the size of the points in pixels.
Parameters:
| Name | Type | Description |
|---|---|---|
size |
Number | size to be set. |
- Source:
setSizeAttenuation(flag)
Turn size attenuation on/off based on the flag.
Parameters:
| Name | Type | Description |
|---|---|---|
flag |
Boolean | Determin either size attenuation should be on or off. |
- Source:
(inner) updateMorphPointset()
Blend positionFrames/colorFrames based on the current inbuildTime and
write the result into the instancePosition/instanceColor attributes.
- Source: