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 Details

    • 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 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

      public SoftwareLightDirectional(SoftwareLightDirectional kThat)
      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:
      colorOf in class SoftwareLight
      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 class SoftwareLight
      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.