variant
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
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/MaterialsVariantsShoe.glb",
variant: null
}
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/MaterialsVariantsShoe.glb",
variant: 1
}
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
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";