Skip to main content

Interface: ModelMobjectOptions

Defined in: src/mobjects/three-d/ModelMobject.ts:64

Options for ModelMobject.fromUrl.

Properties​

center?​

optional center: boolean

Defined in: src/mobjects/three-d/ModelMobject.ts:70

Recenter the model's bounding box to the origin. Default: false.


color?​

optional color: string

Defined in: src/mobjects/three-d/ModelMobject.ts:72

Convenience fill color applied to every mesh material.


loader?​

optional loader: ModelLoader

Defined in: src/mobjects/three-d/ModelMobject.ts:89

Inject a loader directly (bypasses the factory and the network).


loadMaterials?​

optional loadMaterials: boolean

Defined in: src/mobjects/three-d/ModelMobject.ts:85

For .obj only: auto-derive the .mtl URL from the .obj URL and load it. mtlUrl takes priority when both are set. Default: false.


materialOverride?​

optional materialOverride: Material

Defined in: src/mobjects/three-d/ModelMobject.ts:74

Replace every mesh material with this one. Wins over color and MTL.


mtlLoader?​

optional mtlLoader: MtlLoader

Defined in: src/mobjects/three-d/ModelMobject.ts:91

Inject an MTLLoader directly (bypasses the factory and the network).


mtlUrl?​

optional mtlUrl: string

Defined in: src/mobjects/three-d/ModelMobject.ts:80

For .obj only: explicit companion .mtl URL. Its materials and texture maps apply to the meshes. materialOverride and color still win over them. Ignored for glTF, which embeds its materials natively.


onProgress()?​

optional onProgress: (event) => void

Defined in: src/mobjects/three-d/ModelMobject.ts:87

Progress callback forwarded to the loader.

Parameters​

event​

ProgressEvent

Returns​

void


scale?​

optional scale: number | Vector3Tuple

Defined in: src/mobjects/three-d/ModelMobject.ts:66

Uniform factor, or per-axis factors, applied to the loaded model.


throwOnError?​

optional throwOnError: boolean

Defined in: src/mobjects/three-d/ModelMobject.ts:97

When false, a load failure resolves to an empty ModelMobject whose ModelMobject.getLoadError holds the error instead of rejecting. Default: true (the returned promise rejects on failure).


upAxis?​

optional upAxis: ModelUpAxis

Defined in: src/mobjects/three-d/ModelMobject.ts:68

The model's up direction; the model is rotated to the scene up (+Y).