Material
object
material : Useful namespace for helping with Materials and threejs utility functions
Kind: global namespace
- material :
object
- .getObjectMaterial(parent) ⇒
object
- .setObjectMaterial(parent, material) ⇒
object
- .loadTextureAsync(src) ⇒
object
- .loadVideoTextureAsync(video) ⇒
object
- .getObjectMaterial(parent) ⇒
object
material.getObjectMaterial(parent) ⇒ Given the parent, grabs either the parent’s direct material or (in the case of a group) the material of the first child hit.
Kind: static method of material
Returns: object
- material - the grabbed material
Param | Type | Description |
---|---|---|
parent | object |
either a THREE.Group or a THREE.mesh/object |
object
material.setObjectMaterial(parent, material) ⇒ Given the parent, grabs either the parents direct material or (in the case of a group) the material of the first child hit.
Kind: static method of material
Returns: object
- parent - the updated parent object
Param | Type | Description |
---|---|---|
parent | object |
either a THREE.Group or a THREE.mesh/object |
material | object |
a threejs material to be set for either the parent’s direct material or (in the case of a group) the material of all children within the parent group. |
object
material.loadTextureAsync(src) ⇒ Function to load the texture asynchronously and return a promise
Kind: static method of material
Returns: object
- texture - the fully loaded texture
Param | Type | Description |
---|---|---|
src | object |
the url path to the data to be loaded |
object
material.loadVideoTextureAsync(video) ⇒ Function to load the texture asynchronously and return a promise
Kind: static method of material
Returns: object
- texture - the fully loaded texture
Param | Type | Description |
---|---|---|
video | object |
the html video element whose src contains the path to the data to be loaded |