Skip to content

Class: SurfaceLayer

Defined in: plot3d/surface.ts:77

A drawable in the 3D scene. Positions are in world space; Plot3D supplies the MVP.

Implements

Constructors

Constructor

ts
new SurfaceLayer(gl, opts): SurfaceLayer;

Defined in: plot3d/surface.ts:98

Parameters

ParameterType
glWebGL2RenderingContext
optsSurfaceOptions

Returns

SurfaceLayer

Properties

id

ts
readonly id: string;

Defined in: plot3d/surface.ts:78

Implementation of

Layer3D.id


name?

ts
readonly optional name?: string;

Defined in: plot3d/surface.ts:79

Series name for the legend (optional).

Implementation of

Layer3D.name

Methods

bounds3()

ts
bounds3(): Bounds3;

Defined in: plot3d/surface.ts:200

Returns

Bounds3

Implementation of

Layer3D.bounds3


colorInfo()

ts
colorInfo(): ColorInfo;

Defined in: plot3d/surface.ts:202

Colormap + value range for a colorbar, if this layer is colormapped.

Returns

ColorInfo

Implementation of

Layer3D.colorInfo


dispose()

ts
dispose(): void;

Defined in: plot3d/surface.ts:225

Returns

void

Implementation of

Layer3D.dispose


draw()

ts
draw(gl, mvp): void;

Defined in: plot3d/surface.ts:210

Parameters

ParameterType
glWebGL2RenderingContext
mvpMat4

Returns

void

Implementation of

Layer3D.draw


setData()

ts
setData(values, opts?): void;

Defined in: plot3d/surface.ts:190

Stream a new height grid (mesh/normals/wireframe rebuilt). Call plot.refresh() after.

Parameters

ParameterType
valuesArrayLike<number>
opts?{ cols?: number; extentX?: Range; extentZ?: Range; rows?: number; }
opts.cols?number
opts.extentX?Range
opts.extentZ?Range
opts.rows?number

Returns

void


setLight()

ts
setLight(dir, ambient): void;

Defined in: plot3d/surface.ts:205

Set the light direction (world space) and ambient term (0..1).

Parameters

ParameterType
dir[number, number, number]
ambientnumber

Returns

void

MIT licensed. WebGL2 required.