Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ModelStyle

Interface for configuring the visual appearance of Models. The default orientation is with the Y axis pointing up.

experimental

Hierarchy

  • ModelStyle

Index

Properties

Optional cullFace

cullFace: "Front" | "Back" | false

Configure Face culling. To enable culling set cullFace to "Front" or "Back", to disable set to false. The used winding order is counter-clock-wise. Face culling is disabled by default.

defaultvalue:

false

Optional emissive

Sets the emissive color of the "Model", giving it a glow effect.

Combination with Material Emissive:

  • The provided emissive color value will be combined with Material.emissive through color addition.
see

Color for a detailed list of possible supported formats.

Optional light

light: string

Specifies the name of the light group to use for illuminating specific features on a layer. This property must reference a key corresponding to a light group defined in LayerStyle.lights. A light group consists of lighting sources such as ambient or directional lights that affect the appearance of features.

If light is not defined, the default light group "defaultLight" will be used to illuminate the layer's features.

see

LayerStyle.lights for defining and referencing available light groups.

defaultvalue

"defaultLight"

model

model: string | ModelData

The Model data that should be rendered. In addition to passing the model directly, a string can also be provided that references a Wavefront OBJ file.

example

{zIndex: 0, type: "Model", model: "./MyModel.obj"}

Optional rotate

rotate: number[]

rotate the model by the given vector [radX,radY,radZ]. The order of rotation is x first, then y, followed by z.

Optional scale

scale: number[]

Scale the model by the given vector [sx,sy,sz].

Optional shininess

shininess: number

Sets the shininess of the "Model", determining how glossy its surface appears. A higher value makes the ``"Model"` surface more reflective.

Combination with Material Shininess:

Relationship with Specular

  • Effect: The shininess value controls the size and intensity of the specular highlight, which is colored by the specular property.
  • Specular Dependency: The shininess property enhances the effect of the specular color. If specular is not set, shininess has no visible effect.

Shininess Value Range and Effect

  • Range: The shininess value typically ranges from 0 to 128.
  • Low Values (0-10): Produce a wide, diffused highlight, resulting in a matte or dull appearance.
  • High Values (50-128): Produce a small, intense highlight, resulting in a glossy or shiny appearance.
defaultvalue

32

Optional specular

Sets the specular color of the "Model", affecting how it reflects light.

Combination with Material Specular:

  • The provided specular value will be combined with Material.specular through color addition.

Relationship with Shininess

  • Effect: The specular property determines the color of the light reflection, while the shininess value controls the intensity and size of the reflection.
  • Shininess Dependency: If specular is set and shininess is not explicitly set, the default shininess value will be used to control the reflection's appearance.
see

Color for a detailed list of possible supported formats.

Optional transform

transform: number[]

4x4 transformation matrix to transform the model. if transform is defined, scale, translate and rotate are ignored.

Optional translate

translate: number[]

Translate the model by the given vector [tx,ty,tz].

type

type: "Model"

Specifies the type of style to render.

zIndex

zIndex: number | StyleValueFunction<number> | StyleZoomRange<number> | StyleExpression<number>

Indicates the drawing order within a layer. Styles with larger zIndex value are rendered above those with smaller values. The zIndex is defined relative to the "zLayer" property. If "zLayer" is defined all zIndex values are relative to the "zLayer" value.

Optional zLayer

zLayer: number | StyleValueFunction<number> | StyleExpression<number>

Indicates drawing order across multiple layers. Styles using zLayer with a high value are rendered on top of zLayers with a low value. If no zLayer is defined, it will fall back to the LayerStyle.zLayer or depend on the display layer order. The first (lowest) layer has a zLayer value of 1.

example

{...zLayer: 2, zIndex: 5} will be rendered on top of {...zLayer: 1, zIndex: 10}

Generated using TypeDoc