PhongWrapMaterial

PhongWrapMaterial

Add a "Phong layer" to a given material. The material passed in the constructor is used as the ambient color of the Phong shading model

Constructor

new PhongWrapMaterial(material, params)

Source:

Constructor.

Parameters:
Name Type Description
material Material

the material defining the base color

params Object

the parameters of the Phong layer:

  • {number} ambient - the ambient reflection constant
  • {number} diffuse - the diffuse reflection constant
  • {number} specular - the specular reflection constant
  • {number} shininess - the shininess reflection constant
  • {Light[]} lights - light affecting the material

Classes

PhongWrapMaterial

Members

ambient :number

Source:

ambient reflection constant

Type:
  • number

diffuse :number

Source:

diffuse reflection constant

Type:
  • number

lights :Array.<Light>

Source:

lights affecting the material

Type:

material :Material

Source:

material defining the base color

Type:

reflectivity :Color

Source:

Reflectivity of the material

Type:
  • Color

shininess :number

Source:

shininess reflection constant

Type:
  • number

specular :number

Source:

specular reflection constant

Type:
  • number

Methods

onAdd(scene)

Source:

Additional actions to perform when the object is added to the scene. Propagate the call.

Parameters:
Name Type Description
scene Scene

the scene to which the object is added.

setId(scene)

Source:

Set the ID of the shape. Propagate the call.

Parameters:
Name Type Description
scene Scene

the scene to which the object is added.