Options to create a mesh with create3DMesh.

Hierarchy

  • MeshCreateOptions

Properties

colors?: number[]

An array of (R,G,B,A) colors. Each set of (R,G,B,A) colors must match exactly one (X,Y,Z) position in the positions array. If both colors and texture coordinates are given for a vertex, then the resulting color will be combined by multiplying the value of the image with the value of the color of the vertex. This allows the colors attribute to act as a modulation color on top of a texture.

The texture used by the 3D mesh. It can either be a static image which can be :

  • An HTMLImageElement
  • An HTMLCanvasElement
  • A path to an image

Or it can be a HTMLVideoElement. For more information about using videos as textures: Howto: Visualizing 3D icons

normals?: number[]

An array of (X,Y,Z) normals. Each (X,Y,Z) normal should match exactly one (X,Y,Z) position. Normals have an effect on lighting, and should point outwards.

texCoords?: number[]

An array of (U,V) coordinates. Each set of (U,V) coordinates must match one (X,Y,Z) position in the positions array. The (U,V) coordinates map to the image parameter.