Package com.ijurnove.cpu3d
Class Material
java.lang.Object
com.ijurnove.cpu3d.Material
The
Material class defines how light interacts with a surface. Specular, diffuse, and ambient values are given by the PhongComponents, but the
emissive value is stored in a double array. A Material with an emissive value greater than 0 will always be illuminated by that color. The emissive component
is represented by a double[] with three values, each corresponding to red, green, or blue respectively.
The shininess field determines the characteristics of the specular highlight. A larger shininess value results in a smaller, more concentrated highlight, and a smaller value will result in a larger, more diffused highlight.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMaterial(PhongComponents phongComponents, double[] emissive, double shininess) Constructs aMaterialwith the specifiedPhongComponents, emissive value, and shininess. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns the emissive component, represented by adouble[]with three values, each corresponding to red, green, or blue respectively.Returns thePhongComponents.doubleReturns the shininess value.
-
Field Details
-
PLASTIC
An example material.Ambient: 255, 255, 255
Diffuse: 255, 255, 255
Specular: 255, 255, 255
Emissive: 0, 0, 0
Shininess: 32 -
STONE
An example material.Ambient: 255, 255, 255
Diffuse: 255, 255, 255
Specular: 16, 16, 16
Emissive: 0, 0, 0
Shininess: 0.5 -
METAL
An example material.Ambient: 255, 255, 255
Diffuse: 255, 255, 255
Specular: 128, 128, 128
Emissive: 0, 0, 0
Shininess: 8
-
-
Constructor Details
-
Material
Constructs aMaterialwith the specifiedPhongComponents, emissive value, and shininess. The emissive component is represented by adouble[]with three values, each corresponding to red, green, or blue respectively.- Parameters:
phongComponents- the specified PhongComponentsemissive- the emissive light colorshininess- the shininess exponent
-
-
Method Details
-
getPhongComponents
Returns thePhongComponents.- Returns:
- the PhongComponents
-
getShininess
public double getShininess()Returns the shininess value.- Returns:
- the shininess value
-
getEmissive
public double[] getEmissive()Returns the emissive component, represented by adouble[]with three values, each corresponding to red, green, or blue respectively.- Returns:
- the emissive component
-