Skip to main content

Interface: ModelMobjectOptions

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

Options for ModelMobject.fromUrl.

Properties​

center?​

optional center: boolean

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

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


color?​

optional color: string

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

Convenience fill color applied to every mesh material.


loader?​

optional loader: ModelLoader

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

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


loadMaterials?​

optional loadMaterials: boolean

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

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:75

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


mtlLoader?​

optional mtlLoader: MtlLoader

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

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


mtlUrl?​

optional mtlUrl: string

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

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:88

Progress callback forwarded to the loader.

Parameters​

event​

ProgressEvent

Returns​

void


scale?​

optional scale: number | Vector3Tuple

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

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


throwOnError?​

optional throwOnError: boolean

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

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:69

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