Functions from OpenGL library are used to plot 3D view. According to this the parameters used in the 3D regime are similar to the standard OpenGL parameters of lighting equation. The equation is as follows:
, where
- Material Emission,
- Ambient color of the material (Material Color),
- Diffuse color of the material. (Material Color),
- Specular color of the material (Material Specular),
- Scene Ambient light intensity,
- The number of light sources (in our case this parameter is equal to 1 if the lighting is turned on, and to 0 if it is turned off),
- Ambient light intensity,
- Diffuse light intensity,
- Specular light intensity,
- Normal vector to the surface,
- Unit vector directed from a current point on the surface to the light source,
- Unit vector directed from a current point on the surface to the camera,
- Material Shininess.