MotionScript

@motion-script/core


@motion-script/core / BufferGeometry3D

Interface: BufferGeometry3D

Defined in: render3d/geometry.ts:183

Raw vertex buffers — the general escape hatch that makes any computable mesh expressible without leaving pure data.

position is required and holds [x, y, z, x, y, z, …]. index lets vertices be shared between faces. Omit normal and set computeNormals to have them derived.

Extends

Properties

color?

optional color?: ArrayLike<number>

Defined in: render3d/geometry.ts:192

Flat linear rgb triples. Needs vertexColors: true on the material.


computeNormals?

optional computeNormals?: boolean

Defined in: render3d/geometry.ts:196

Derive vertex normals after upload — needed for correct lighting.


index?

optional index?: ArrayLike<number>

Defined in: render3d/geometry.ts:194

Triangle indices into the arrays above.


normal?

optional normal?: ArrayLike<number>

Defined in: render3d/geometry.ts:188

Flat xyz triples. Omit and set computeNormals to derive them.


params?

optional params?: Record<string, unknown>

Defined in: render3d/geometry.ts:14

Inherited from

Passthrough3D.params


position

position: ArrayLike<number>

Defined in: render3d/geometry.ts:186

Flat xyz triples.


revision?

optional revision?: number

Defined in: render3d/geometry.ts:209

Bump after mutating an array in place to force a re-upload.

Reusing one Float32Array across frames and writing into it is the fast way to animate a mesh, but it defeats identity comparison — the renderer sees the same array object and cannot tell the contents changed. Bumping revision tells it explicitly.

With revision omitted the renderer re-uploads every frame, which is correct-by-default for a buffer you built deliberately. Set staticData once the data stops changing.


staticData?

optional staticData?: boolean

Defined in: render3d/geometry.ts:214

Declare the arrays immutable, so the renderer compares by identity alone and skips the per-frame re-upload. Only safe when you never mutate in place.


type

type: "buffer"

Defined in: render3d/geometry.ts:184


uv?

optional uv?: ArrayLike<number>

Defined in: render3d/geometry.ts:190

Flat uv pairs.