Skip to main content

Function: applyObjMaterials()

applyObjMaterials(loader, objUrl, options): Promise<void>

Defined in: src/mobjects/three-d/objMaterials.ts:121

Load the companion .mtl and hand its materials to the OBJ loader before it parses. Call this on the resolved OBJ loader before loadAsync.

It is a no-op when neither mtlUrl nor loadMaterials is set (so an OBJ loads exactly as before), and when the loader cannot accept materials. The MTLLoader base path and resource path come from the .mtl URL, so texture maps named in the .mtl load from the same directory.

Parameters​

loader​

ModelLoader

objUrl​

string

options​

ObjMaterialOptions

Returns​

Promise<void>