Package gov.nih.mipav.view.renderer.J3D
Class SoftwareLightAmbient
- java.lang.Object
-
- gov.nih.mipav.view.renderer.J3D.SoftwareLight
-
- gov.nih.mipav.view.renderer.J3D.SoftwareLightAmbient
-
public class SoftwareLightAmbient extends SoftwareLight
The class for ambient lights in a general lighting system to calculate ambient colors at a point in space. The other derived classes for lights make no ambient contribution, only diffuse and specular. As such, at most one ambient light is really needed in an environment.See ShearWarpRendering.pdf for a detailed description of the lighting model.
-
-
Field Summary
-
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 SoftwareLightAmbient()
Construct an ambient light.SoftwareLightAmbient(SoftwareLightAmbient 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.-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.SoftwareLight
addAmbient, addDiffuse, addSpecular, initView, normalize
-
-
-
-
Constructor Detail
-
SoftwareLightAmbient
public SoftwareLightAmbient()
Construct an ambient light. The default colors are all black, the intensity is zero, and the light is off. The attenuation parameter are set to 1 (no attenuation) since an ambient light does not have a position that identifies its source.
-
SoftwareLightAmbient
public SoftwareLightAmbient(SoftwareLightAmbient 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.
-
-