Skip to content

Interface: Line3D ​

Experimental

Screen-space thick 3D polylines in one instanced draw call (see the module docs).

Implements ​

Properties ​

PropertyModifierTypeDefault valueDescription
materialreadonlyShaderMaterialundefinedExperimental
objectreadonlyMesh<InstancedBufferGeometry, ShaderMaterial>undefinedExperimental Root object to add to a viewport's scene.
pickKindreadonlyPickElementKind'point'Experimental Pick ids count input points (the nearer vertex of the segment under the cursor).

Accessors ​

instanceCount ​

Get Signature ​

ts
get instanceCount(): number;

Experimental

Number of segment instances drawn (including culled gap instances).

Returns ​

number


opaque ​

Get Signature ​

ts
get opaque(): boolean;

Experimental

Whether the line is drawn opaque (depth-writing, see blend3d.ts).

Returns ​

boolean


pickCount ​

Get Signature ​

ts
get pickCount(): number;

Experimental

Number of pick ids: one per input point.

Returns ​

number

Implementation of ​

ts
PickablePrimitive.pickCount;

Methods ​

createPickMaterial() ​

ts
createPickMaterial(): PickMaterialHandle;

Experimental

Pick material (E2.13): the same shaders with PICKING defined, sharing every uniform except the resolution and viewport (the pick window's) and the pick id base.

Returns ​

PickMaterialHandle

Implementation of ​

ts
PickablePrimitive.createPickMaterial;

dispose() ​

ts
dispose(): void;

Experimental

Release GPU resources. The primitive must not be used afterwards.

Returns ​

void

Implementation of ​

ts
Primitive.dispose;

setTransform() ​

ts
setTransform(transform): void;

Experimental

Set the data → world transform (cheap: uniforms only, no buffer uploads).

Parameters ​

ParameterType
transformDataTransform

Returns ​

void

Implementation of ​

ts
Primitive.setTransform;

setViewport() ​

ts
setViewport(size): void;

Experimental

Update viewport-dependent uniforms (resolution, pixel ratio).

Parameters ​

ParameterType
sizeViewportSize

Returns ​

void

Implementation of ​

ts
Primitive.setViewport;

syncCamera() ​

ts
syncCamera(camera): void;

Experimental

Bring the dash phase up to date for camera now (it is otherwise refreshed from the frames the line is drawn in, one frame late after a change). The camera's world matrices must be current. No-op for solid lines.

Parameters ​

ParameterType
cameraCamera

Returns ​

void


update() ​

ts
update(patch): void;

Experimental

Replace or patch the primitive's data. Omitted fields keep their previous values.

Parameters ​

ParameterType
patchPartial<Line3DData>

Returns ​

void

Implementation of ​

ts
Primitive.update;

Released under the MIT License.