vmm.core3D
Class LightSettings

java.lang.Object
  extended by vmm.core3D.LightSettings

public class LightSettings
extends java.lang.Object

This 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
static int DEFAULTS
          To be used as a parameter to the one-parameter constructor, representing default light settings.
static int DISTICTLY_COLORED_SIDES_DEFAULT
          To be used as a parameter to the one-parameter constructor, representing settings appropriate for "distinctly colored sides".
static 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.
static int WHITE_LIGHT
          To be used as a parameter to the one-parameter constructor, representing a light setting in which all lights are white.
 
Constructor Summary
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 ratio
LightSettings(int code)
          Create one of the default light settings.
 
Method Summary
 java.awt.Color getAmbientLight()
           
 DirectionalLight getDirectionalLight1()
           
 DirectionalLight getDirectionalLight2()
           
 DirectionalLight getDirectionalLight3()
           
 java.awt.Color getLight0()
           
 int getSpecularExponent()
           
 float getSpecularRatio()
           
 void setAmbientLight(java.awt.Color ambientLight)
           
 void setDirectionalLight1(DirectionalLight directionalLight1)
           
 void setDirectionalLight2(DirectionalLight directionalLight2)
           
 void setDirectionalLight3(DirectionalLight directionalLight3)
           
 void setLight0(java.awt.Color light0)
           
 void setSpecularExponent(int specularExponent)
           
 void setSpecularRatio(float specularRatio)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)