Options
All
  • Public
  • Public/Protected
  • All
Menu

A drawing context which builds and draws a dynamic 3D lit (normal-carrying) mesh on the fly.

This is the TypeScript / WebAssembly equivalent of the WPF ImmediateLitMeshContext. It is a thin wrapper around the native {@link SCRTImmediateLitMeshDrawingProvider}: the JS side only accumulates plain vertex data (position / normal / texcoord / color / selection id) and passes it as a struct; all command-buffer, pipeline and material handling happens natively inside the provider.

Build geometry one vertex at a time — set the per-vertex attributes (normal3 / texCoord2 / setVertexColor / setSelectionId) then call setVertex3, which emits a vertex using the current attribute state. Call dispose to submit the draw call and release native resources.

const ctx = new ImmediateLitMeshContext(wasmContext, renderMode);
ctx.normal3(0, 1, 0);
ctx.setVertexColor("#FF6600");
ctx.setVertex3(x, y, z); // emits a vertex
// ...more vertices...
ctx.dispose();           // submits the mesh

Hierarchy

  • ImmediateLitMeshContext

Index

Constructors

constructor

  • Creates an instance of ImmediateLitMeshContext and begins an immediate-mode rendering session.

    remarks

    Cull mode (none) and depth mode (enabled) are fixed by the native provider.

    Parameters

    • webAssemblyContext: TSciChart3D

      The TSciChart3D WebAssembly context.

    • renderMode: eTSRRenderMode

      The render mode (triangles, triangle-strip, lines etc.) for the submitted geometry.

    Returns ImmediateLitMeshContext

Methods

dispose

  • dispose(): void
  • Submits the accumulated geometry to the native provider for rendering, then releases native resources.

    Returns void

normal3

  • normal3(nx: number, ny: number, nz: number): void
  • Sets the normal applied to subsequently emitted vertices, used by the lighting model.

    Parameters

    • nx: number
    • ny: number
    • nz: number

    Returns void

setSelectionId

  • setSelectionId(selectionId: number): void
  • Sets the selection identifier applied to subsequently emitted vertices.

    Parameters

    • selectionId: number

    Returns void

setVertex3

  • setVertex3(x: number, y: number, z: number): void
  • Emits a vertex at the given X,Y,Z position using the current normal / texcoord / color / selection state.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

setVertex3v

  • setVertex3v(vector: Vector3): void
  • Emits a vertex from a Vector3 position using the current attribute state.

    Parameters

    Returns void

setVertexColor

  • setVertexColor(color: string | number): void
  • Sets the color applied to subsequently emitted vertices.

    Parameters

    • color: string | number

      Either an HTML/CSS color string (e.g. "#FF6600") or a 32-bit ARGB number.

    Returns void

texCoord2

  • texCoord2(u: number, v: number): void
  • Sets the texture coordinate applied to subsequently emitted vertices.

    Parameters

    • u: number
    • v: number

    Returns void

Generated using TypeDoc