Package com.ijurnove.cpu3d
Class PhongComponents
java.lang.Object
com.ijurnove.cpu3d.PhongComponents
A
PhongComponents object contains information about lighting, for the Blinn-Phong lighting model. Each PhongComponents has an ambient color, a diffuse color, and a specular color.
Ambient lighting illuminates the entire scene at once, diffuse lighting is matte, and specular lighting is a shiny highlight seen on smooth objects.
RGB components range from 0-1, but can be set higher for a more intense light/reflection.
-
Constructor Summary
ConstructorsConstructorDescriptionPhongComponents(double[] ambient, double[] diffuse, double[] specular) Constructs aPhongComponentswith the given ambient, diffuse, and specular RGB values.PhongComponents(int[] ambient, int[] diffuse, int[] specular) Constructs aPhongComponentswith the given ambient, diffuse, and specular RGB values. -
Method Summary
-
Constructor Details
-
PhongComponents
public PhongComponents(double[] ambient, double[] diffuse, double[] specular) Constructs aPhongComponentswith the given ambient, diffuse, and specular RGB values. Values range from 0-1.- Parameters:
ambient- the ambient colordiffuse- the diffuse colorspecular- the specular color
-
PhongComponents
public PhongComponents(int[] ambient, int[] diffuse, int[] specular) Constructs aPhongComponentswith the given ambient, diffuse, and specular RGB values. Values range from 0-255.- Parameters:
ambient- the ambient colordiffuse- the diffuse colorspecular- the specular color
-
-
Method Details
-
getAmb
public double[] getAmb()Returns the ambient color component. Values range from 0-1.- Returns:
- the ambient color component
-
getDiff
public double[] getDiff()Returns the diffuse color component. Values range from 0-1.- Returns:
- the diffuse color component
-
getSpec
public double[] getSpec()Returns the specular color component. Values range from 0-1.- Returns:
- the specular color component
-