new MTLLoader()
Loads a Wavefront .mtl file specifying materials
- Source:
Methods
-
load(url [, onLoad] [, onProgress] [, onError])
-
Loads and parses a MTL asset from a URL.
Parameters:
Name Type Argument Description urlString URL to the MTL file.
onLoadfunction <optional>
Callback invoked with the loaded object.
onProgressfunction <optional>
Callback for download progress.
onErrorfunction <optional>
Callback for download errors.
- Source:
- See:
-
- setPath setTexturePath
-
setPath(path)
-
Set base path for resolving references. If set this path will be prepended to each loaded and found reference.
Parameters:
Name Type Description pathString - Source:
- See:
-
- setTexturePath
Example
mtlLoader.setPath( 'assets/obj/' ); mtlLoader.load( 'my.mtl', ... ); -
setTexturePath(path)
-
Set base path for resolving texture references. If set this path will be prepended found texture reference. If not set and setPath is, it will be used as texture base path.
Parameters:
Name Type Description pathString - Source:
- See:
-
- setPath
Example
mtlLoader.setPath( 'assets/obj/' ); mtlLoader.setTexturePath( 'assets/textures/' ); mtlLoader.load( 'my.mtl', ... ); -
parse(text)
-
Parses a MTL file.
Parameters:
Name Type Description textString Content of MTL file
- Source:
- See:
-
- setPath setTexturePath
Returns:
- Type
- THREE.MTLLoader.MaterialCreator
-
<static> MaterialCreator(baseUrl, options)
-
Create a new THREE-MTLLoader.MaterialCreator
Parameters:
Name Type Description baseUrlUrl relative to which textures are loaded
optionsSet of options on how to construct the materials side: Which side to apply the material THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide wrap: What type of wrapping to apply for textures THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping normalizeRGB: RGBs need to be normalized to 0-1 from 0-255 Default: false, assumed to be already normalized ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's Default: false
- Source: