Package gov.nih.mipav.view.renderer.J3D
Class SoftwareLightDirectional
java.lang.Object
gov.nih.mipav.view.renderer.J3D.SoftwareLight
gov.nih.mipav.view.renderer.J3D.SoftwareLightDirectional
The class for directional lights in a general lighting system to calculate diffuse and specular colors at a point in
space.
See ShearWarpRendering.pdf for a detailed description of the lighting model.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) javax.vecmath.Color3fDOCUMENT ME!(package private) javax.vecmath.Color3fDOCUMENT ME!protected final javax.vecmath.Vector3fthe light's direction in the world.(package private) javax.vecmath.Vector3fDOCUMENT ME!(package private) javax.vecmath.Vector3fDOCUMENT ME!(package private) javax.vecmath.Vector3fDOCUMENT ME!(package private) javax.vecmath.Color3fDOCUMENT ME!(package private) javax.vecmath.Color3fDOCUMENT ME!(package private) javax.vecmath.Vector3fDOCUMENT ME!Fields inherited from class gov.nih.mipav.view.renderer.J3D.SoftwareLight
ambient, diffuse, intensity, m_fAttenuate, m_fSpot, m_kColor, m_kNormal, m_kReflect, m_kView, on, specular -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a directional light.Copy (deep) constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal javax.vecmath.Color3fcolorOf(SoftwareMaterial kMaterial, SoftwareVertexProperty kVertexProperty, javax.vecmath.Point3f kEye) Compute the contribution of color from this light on the specified material with specified vertex properties.copy()Create a deep copy of this Light instance.final javax.vecmath.Vector3fGet the light direction.final voidsetDirection(float fX, float fY, float fZ) Set the light direction.final voidsetDirection(javax.vecmath.Vector3f v) Set the light direction.Methods inherited from class gov.nih.mipav.view.renderer.J3D.SoftwareLight
addAmbient, addDiffuse, addSpecular, initView, normalize
-
Field Details
-
direction
protected final javax.vecmath.Vector3f directionthe light's direction in the world. -
ambientColor
javax.vecmath.Color3f ambientColorDOCUMENT ME! -
diffuseColor
javax.vecmath.Color3f diffuseColorDOCUMENT ME! -
L
javax.vecmath.Vector3f LDOCUMENT ME! -
N
javax.vecmath.Vector3f NDOCUMENT ME! -
R
javax.vecmath.Vector3f RDOCUMENT ME! -
result
javax.vecmath.Color3f resultDOCUMENT ME! -
specularColor
javax.vecmath.Color3f specularColorDOCUMENT ME! -
V
javax.vecmath.Vector3f VDOCUMENT ME!
-
-
Constructor Details
-
SoftwareLightDirectional
public SoftwareLightDirectional()Construct a directional light. The default colors are all black, the intensity is zero, and the light is off. The attenuation parameters are set to 1 (no attenuation) since a directional light does not have a position that identifies its source. The default direction is the zero vector. -
SoftwareLightDirectional
Copy (deep) constructor.- Parameters:
kThat- Light What to make "this" light like.
-
-
Method Details
-
colorOf
public final javax.vecmath.Color3f colorOf(SoftwareMaterial kMaterial, SoftwareVertexProperty kVertexProperty, javax.vecmath.Point3f kEye) Compute the contribution of color from this light on the specified material with specified vertex properties.- Specified by:
colorOfin classSoftwareLight- Parameters:
kMaterial- SoftwareMaterial Default properties for the material including emissive, ambient, diffuse, and specular colors along with the specular shininess which can be used to disable specular highlighting.kVertexProperty- SoftwareVertexProperty Properties of the vertex which include its position and normal vector along with optional material property overrides for the diffuse and specular colors.kEye- Point3f The location of the observer in the coordinate system defined for the light.- Returns:
- Color3f Reference to the computed color contribution by this light with this vertex and its material properties. The instance returned is owned by this light.
-
copy
Create a deep copy of this Light instance.- Specified by:
copyin classSoftwareLight- Returns:
- Light Deep copy of this Light instance.
-
getDirection
public final javax.vecmath.Vector3f getDirection()Get the light direction.- Returns:
- direction light direction
-
setDirection
public final void setDirection(javax.vecmath.Vector3f v) Set the light direction.- Parameters:
v- light direction
-
setDirection
public final void setDirection(float fX, float fY, float fZ) Set the light direction.- Parameters:
fX- float X coordinate of the light direction vector.fY- float Y coordinate of the light direction vector.fZ- float Z coordinate of the light direction vector.
-