MTLLoader

A loader for loading an .mtl resource, used internaly by OBJMTLLoader and UTF8Loader.

Constructor

MTLLoader( baseUrl, options, crossOrigin )

baseUrl — The base url from which to find subsequent resources.
options — Options passed to the created material (side, wrap, normalizeRGB, ignoreZeroRGBs).
crossOrigin — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Creates a new MTLLoader.

Properties

Methods

.load ( url, onLoad, onProgress, onError )

url — required
onLoad — Will be called when load completes. The argument will be the loaded MTLLoader.MaterialCreator instance.
onProgress — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .total and .loaded bytes.
onError — Will be called when load errors.
Begin loading from url and return the loaded material.

.parse ( text )

text — The textual mtl structure to parse.
Parse a mtl text structure and return a MTLLoaderMaterialCreator instance.

Source

examples/js/loaders/MTLLoader.js
Edit