Skip to content

PointsRenderable ​

A set of point markers drawn as screen-space sprites.

Each point has a world-space position, a color, a size in pixels, and a marker shape. All instances share a single marker sprite atlas. The point set is fixed at construction, so build a new instance to change it. Construct these directly inside a custom Layer.

ts
class Particles extends Layer {
  public readonly type = "Particles";

  constructor(positions: vec3[]) {
    super();
    this.addObject(
      new PointsRenderable(
        positions.map((position) => ({
          position,
          color: Color.RED,
          size: 20,
          marker: "circle" as const,
        }))
      )
    );
    this.setState("ready");
  }

  public update() {}
}

Extends RenderableObject and inherits all public properties and methods.

Constructor ​

Creates a renderable drawing one marker per entry.

ts
new PointsRenderable(points): PointsRenderable;
ParameterDescription
points: PointProps[]The points to draw.

Types ​

PointProps ​

Initialization properties for a point in PointsRenderable.

PropertyDescription
position: vec3World-space position of the point.
color: ColorLikeFill color of the marker.
size: numberMarker size in pixels.
marker: MarkerMarker shape.

Accessors ​

type string overrides ​

Identifies the renderable type as PointsRenderable.

ts
get type(): string;

Released under the MIT License