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
-
public class SoftwareLightDirectional extends SoftwareLight
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
Fields Modifier and Type Field Description (package private) javax.vecmath.Color3f
ambientColor
DOCUMENT ME!(package private) javax.vecmath.Color3f
diffuseColor
DOCUMENT ME!protected javax.vecmath.Vector3f
direction
the light's direction in the world.(package private) javax.vecmath.Vector3f
L
DOCUMENT ME!(package private) javax.vecmath.Vector3f
N
DOCUMENT ME!(package private) javax.vecmath.Vector3f
R
DOCUMENT ME!(package private) javax.vecmath.Color3f
result
DOCUMENT ME!(package private) javax.vecmath.Color3f
specularColor
DOCUMENT ME!(package private) javax.vecmath.Vector3f
V
DOCUMENT 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
Constructors Constructor Description SoftwareLightDirectional()
Construct a directional light.SoftwareLightDirectional(SoftwareLightDirectional kThat)
Copy (deep) constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.SoftwareLight
copy()
Create a deep copy of this Light instance.javax.vecmath.Vector3f
getDirection()
Get the light direction.void
setDirection(float fX, float fY, float fZ)
Set the light direction.void
setDirection(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 Detail
-
direction
protected final javax.vecmath.Vector3f direction
the light's direction in the world.
-
ambientColor
javax.vecmath.Color3f ambientColor
DOCUMENT ME!
-
diffuseColor
javax.vecmath.Color3f diffuseColor
DOCUMENT ME!
-
L
javax.vecmath.Vector3f L
DOCUMENT ME!
-
N
javax.vecmath.Vector3f N
DOCUMENT ME!
-
R
javax.vecmath.Vector3f R
DOCUMENT ME!
-
result
javax.vecmath.Color3f result
DOCUMENT ME!
-
specularColor
javax.vecmath.Color3f specularColor
DOCUMENT ME!
-
V
javax.vecmath.Vector3f V
DOCUMENT ME!
-
-
Constructor Detail
-
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
public SoftwareLightDirectional(SoftwareLightDirectional kThat)
Copy (deep) constructor.- Parameters:
kThat
- Light What to make "this" light like.
-
-
Method Detail
-
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:
colorOf
in 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
public SoftwareLight copy()
Create a deep copy of this Light instance.- Specified by:
copy
in 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.
-
-