vmm3d.core3D
Class LightSettings
- java.lang.Object
-
- vmm3d.core3D.LightSettings
-
public class LightSettings extends java.lang.ObjectThis class encapsulates the data associated with a lighting environment that will be used to implement Phong Lighting to illuminate a surface, using either Flat Shading (each patch has a constant color) or Phong Shading (each pixel gets its own color). There is a point source light0 located at ViewPoint and three directional lights. Also provided is an ambient light color, a Specular Ratio, and a Specular Exponent.
-
-
Field Summary
Fields Modifier and Type Field and Description static intDEFAULTSTo be used as a parameter to the one-parameter constructor, representing default light settings.static intDISTICTLY_COLORED_SIDES_DEFAULTTo be used as a parameter to the one-parameter constructor, representing settings appropriate for "distinctly colored sides".static intHIGH_SPECULARITY_DEFAULTTo be used as a parameter to the one-parameter constructor, representing light settings which are the same as the default settings, except for the value of specular exponent and specular ratio and a small increase in ambient light.static intWHITE_LIGHTTo be used as a parameter to the one-parameter constructor, representing a light setting in which all lights are white.
-
Constructor Summary
Constructors Constructor and Description LightSettings()This constructor creates a default LightSettings object that agrees with the one used by 3D-XplorMath.LightSettings(float R0, float G0, float B0, float R1, float G1, float B1, float R2, float G2, float B2, float R3, float G3, float B3, float RA, float GA, float BA, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, float specRatio, int specExponent)This constructor creates a new LightSettings from a list of RGB components of the light colors and direction cosines for the directions the lights are coming from, and finally the specular exponent and ratioLightSettings(int code)Create one of the default light settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.ColorgetAmbientLight()DirectionalLightgetDirectionalLight1()DirectionalLightgetDirectionalLight2()DirectionalLightgetDirectionalLight3()java.awt.ColorgetLight0()intgetSpecularExponent()floatgetSpecularRatio()voidsetAmbientLight(java.awt.Color ambientLight)voidsetDirectionalLight1(DirectionalLight directionalLight1)voidsetDirectionalLight2(DirectionalLight directionalLight2)voidsetDirectionalLight3(DirectionalLight directionalLight3)voidsetLight0(java.awt.Color light0)voidsetSpecularExponent(int specularExponent)voidsetSpecularRatio(float specularRatio)
-
-
-
Field Detail
-
DEFAULTS
public static final int DEFAULTS
To be used as a parameter to the one-parameter constructor, representing default light settings.- See Also:
- Constant Field Values
-
DISTICTLY_COLORED_SIDES_DEFAULT
public static final int DISTICTLY_COLORED_SIDES_DEFAULT
To be used as a parameter to the one-parameter constructor, representing settings appropriate for "distinctly colored sides".- See Also:
- Constant Field Values
-
WHITE_LIGHT
public static final int WHITE_LIGHT
To be used as a parameter to the one-parameter constructor, representing a light setting in which all lights are white.- See Also:
- Constant Field Values
-
HIGH_SPECULARITY_DEFAULT
public static final int HIGH_SPECULARITY_DEFAULT
To be used as a parameter to the one-parameter constructor, representing light settings which are the same as the default settings, except for the value of specular exponent and specular ratio and a small increase in ambient light.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LightSettings
public LightSettings(float R0, float G0, float B0, float R1, float G1, float B1, float R2, float G2, float B2, float R3, float G3, float B3, float RA, float GA, float BA, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, float specRatio, int specExponent)This constructor creates a new LightSettings from a list of RGB components of the light colors and direction cosines for the directions the lights are coming from, and finally the specular exponent and ratio
-
LightSettings
public LightSettings()
This constructor creates a default LightSettings object that agrees with the one used by 3D-XplorMath.
-
LightSettings
public LightSettings(int code)
Create one of the default light settings. The parameter must be one of the codes defined in this class, such as LightSettings.DEFAULTS and LightSettings.VIEWPORT_LIGHT_ONLY. (Other values are accepted, but are treated the same as LightSettings.DEFAULT. Note the LightSettings.DEFAULTS produces the same effect as the parameterless constructor.
-
-
Method Detail
-
getAmbientLight
public java.awt.Color getAmbientLight()
-
setAmbientLight
public void setAmbientLight(java.awt.Color ambientLight)
-
getDirectionalLight1
public DirectionalLight getDirectionalLight1()
-
setDirectionalLight1
public void setDirectionalLight1(DirectionalLight directionalLight1)
-
getDirectionalLight2
public DirectionalLight getDirectionalLight2()
-
setDirectionalLight2
public void setDirectionalLight2(DirectionalLight directionalLight2)
-
getDirectionalLight3
public DirectionalLight getDirectionalLight3()
-
setDirectionalLight3
public void setDirectionalLight3(DirectionalLight directionalLight3)
-
getLight0
public java.awt.Color getLight0()
-
setLight0
public void setLight0(java.awt.Color light0)
-
getSpecularExponent
public int getSpecularExponent()
-
setSpecularExponent
public void setSpecularExponent(int specularExponent)
-
getSpecularRatio
public float getSpecularRatio()
-
setSpecularRatio
public void setSpecularRatio(float specularRatio)
-
-
DMelt 3.0 © DataMelt by jWork.ORG