Import
MTLLoader is an addon, and must be imported explicitly, see Installation#Addons.
import { MTLLoader } from 'three/addons/loaders/MTLLoader.js';
Methods
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback )
Starts loading from the given URL and passes the loaded MTL asset
to the onLoad() callback.
| url |
The path/URL of the file to be loaded. This can also be a data URI. |
| onLoad |
Executed when the loading process has been finished. |
| onProgress |
Executed while the loading is in progress. |
| onError |
Executed when errors occur. |
- Overrides: Loader#load
.parse( text : string, path : string ) : MaterialCreator
Parses the given MTL data and returns the resulting material creator.
| text |
The raw MTL data as a string. |
| path |
The URL base path. |
- Overrides: Loader#parse
- Returns: The material creator.
.setMaterialOptions( value : MTLLoader~MaterialOptions ) : MTLLoader
Sets the material options.
| value |
The material options. |
- Returns: A reference to this loader.
Type Definitions
.MaterialOptions
Material options of MTLLoader.
|
side
FrontSide | BackSide | DoubleSide |
Which side to apply the material. Default is |
|
wrap
RepeatWrapping | ClampToEdgeWrapping | MirroredRepeatWrapping |
What type of wrapping to apply for textures. Default is |
|
normalizeRGB
boolean |
Whether RGB colors should be normalized to Default is |
|
ignoreZeroRGBs
boolean |
Ignore values of RGBs (Ka,Kd,Ks) that are all 0's. Default is |