Class Material
Represents a material, thus a way to express
interaction between light and geometric models.
Defined in: benchgl.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Material(options)
Creates a new Material.
|
Method Attributes | Method Name and Description |
---|---|
setAmbient(r, g, b)
Sets the ambient color of this Material.
|
|
setDiffuse(r, g, b)
Sets the diffuse color of this Material.
|
|
setEmissive(r, g, b)
Sets the emissive color of this Material.
|
|
setShininess(shininess)
Sets the shininess of this Material.
|
|
setSpecular(r, g, b)
Sets the specular color of this Material.
|
Class Detail
Material(options)
Creates a new Material.
- Parameters:
- {Object} options Optional
- Contains parameters to create the material.
- {Object} options.ambient Optional
- Holds the ambient color.
- {Object} options.diffuse Optional
- Holds the diffuse color.
- {Object} options.specular Optional
- Holds the specular color.
- {Object} options.emissive Optional
- Holds the emissive color.
- {Number} options.shininess Optional
- Specifies the shininess of the material.
Method Detail
{Material}
setAmbient(r, g, b)
Sets the ambient color of this Material.
- Parameters:
- {Number} r
- The red component of the color.
- {Number} g
- The green component of the color.
- {Number} b
- The blue component of the color.
- Returns:
- {Material} Returns this Material.
{Material}
setDiffuse(r, g, b)
Sets the diffuse color of this Material.
- Parameters:
- {Number} r
- The red component of the color.
- {Number} g
- The green component of the color.
- {Number} b
- The blue component of the color.
- Returns:
- {Material} Returns this Material.
{Material}
setEmissive(r, g, b)
Sets the emissive color of this Material.
- Parameters:
- {Number} r
- The red component of the color.
- {Number} g
- The green component of the color.
- {Number} b
- The blue component of the color.
- Returns:
- {Material} Returns this Material.
{Material}
setShininess(shininess)
Sets the shininess of this Material.
- Parameters:
- {Number} shininess
- The shininess to set.
- Returns:
- {Material} Returns this Material.
{Material}
setSpecular(r, g, b)
Sets the specular color of this Material.
- Parameters:
- {Number} r
- The red component of the color.
- {Number} g
- The green component of the color.
- {Number} b
- The blue component of the color.
- Returns:
- {Material} Returns this Material.