Skip to main content

variant

Typestring | number | null
Defaultnull

Set material variant of the model, which only can be used when using glTF materials variants extension
Either can be index of the variant(number), or the name of the variant(string)

Example

{
src: "/egjs-view3d/model/MaterialsVariantsShoe.glb",
variant: null
}
{
src: "/egjs-view3d/model/MaterialsVariantsShoe.glb",
variant: 1
}
{
src: "/egjs-view3d/model/MaterialsVariantsShoe.glb",
variant: "street"
}

Changing Variant

You can easily change variant by changing the option value.

Variant:
// You can use index of the variant
view3D.variant = 1;

// Or the name of the variant
view3D.variant = "beach";