Material

material : object

Useful namespace for helping with Materials and threejs utility functions

Kind: global namespace

material.getObjectMaterial(parent) ⇒ object

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

material.setObjectMaterial(parent, material) ⇒ object

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.

material.loadTextureAsync(src) ⇒ object

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

material.loadVideoTextureAsync(video) ⇒ object

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