Class dnx.lr.node.SpotLightNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.node.SpotLightNode

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.lr.Node
                   |
                   +----dnx.lr.LeafNode
                           |
                           +----dnx.lr.node.SpotLightNode

public class SpotLightNode
extends LeafNode
implements GlobalPassViewVolumeNode
 SpotLight {
    exposedField SFFloat      ambientIntensity 0
    exposedField SFVec3f      attenuation     1 0 0
    exposedField SFFloat      beamWidth       1.570796
    exposedField SFColor      color           1 1 1 
    exposedField SFFloat      cutOffAngle     0.785398
    exposedField SFVec3f      direction       0 0 -1
    exposedField SFFloat      intensity       1
    exposedField SFVec3f      location        0 0 0  
    exposedField SFBool       on              TRUE
    exposedField SFFloat      radius          100
 }

The SpotLight node defines a light source that emits light from a specific point along a specific direction vector and constrained within a solid angle. Spotlights may illuminate geometry nodes that respond to light sources and intersect the solid angle. Spotlights are specified in their local coordinate system and are affected by parent transformations.

See "Concepts - Light Sources" for a detailed description of ambientIntensity, color, intensity, and VRML's lighting equations. See "Concepts - Lighting Model" for a detailed description of the VRML lighting equations.

The location field specifies a translation offset of the center point of the light source from the light's local coordinate system origin. This point is the apex of the solid angle which bounds light emission from the given light source. The direction field specifies the direction vector of the light's central axis defined in its own local coordinate system. The on field specifies whether the light source emits light--if TRUE, then the light source is emitting light and may illuminate geometry in the scene, if FALSE it does not emit light and does not illuminate any geometry. The radius field specifies the radial extent of the solid angle and the maximum distance from location than may be illuminated by the light source - the light source does not emit light outside this radius. The radius must be >= 0.0.

The cutOffAngle field specifies the outer bound of the solid angle. The light source does not emit light outside of this solid angle. The beamWidth field specifies an inner solid angle in which the light source emits light at uniform full intensity. The light source's emission intensity drops off from the inner solid angle (beamWidth) to the outer solid angle (cutOffAngle). The drop off function from the inner angle to the outer angle is a cosine raised to a power function:

     intensity(angle) = intensity * (cosine(angle) ** exponent)
     where exponent = 0.5*log(0.5)/log(cos(beamWidth)),
           intensity is the SpotLight's field value,
           intensity(angle) is the light intensity at an arbitrary
               angle from the direction vector,
           and angle ranges from 0.0 at central axis to cutOffAngle.
 

If beamWidth > cutOffAngle, then beamWidth is assumed to be equal to cutOffAngle and the light source emits full intensity within the entire solid angle defined by cutOffAngle. Both beamWidth and cutOffAngle must be greater than 0.0 and less than or equal to PI/2. See figure below for an illustration of the SpotLight's field semantics (note: this example uses the default attenuation).

The light's illumination falls off with distance as specified by three attenuation coefficients. The attenuation factor is 1/(attenuation[0] + attenuation[1]*r + attenuation[2]*r^2), where r is the distance of the light to the surface being illuminated. The default is no attenuation. An attenuation value of 0 0 0 is identical to 1 0 0. Attenuation values must be >= 0.0.


Variable Index

 o ambientIntensity
 o attenuation
 o beamWidth
 o color
 o cutOffAngle
 o direction
 o intensity
 o location
 o on
 o radius

Constructor Index

 o SpotLightNode()

Method Index

 o boundingBoxHasChanged(Field)
Meant to be overridden by subclasses.
 o createNodeDefinition(NodeDefinition)
Create the node definition.
 o getCachedBoundingBox()
For BoundingBoxCachingNode.
 o handleFieldChange(Field)
Handle a field change.
 o handleGlobalPass(NodeInstance, RenderState, Matrix4)
 o initFields()
Initialize field values.
 o recomputeBoundingBox(BoundingBox3)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.

Variables

 o ambientIntensity
  public SFFloat ambientIntensity
 o attenuation
  public SFVec3f attenuation
 o beamWidth
  public SFFloat beamWidth
 o color
  public SFColor color
 o cutOffAngle
  public SFFloat cutOffAngle
 o direction
  public SFVec3f direction
 o intensity
  public SFFloat intensity
 o location
  public SFVec3f location
 o on
  public SFBool on
 o radius
  public SFFloat radius

Constructors

 o SpotLightNode
  public SpotLightNode()

Methods

 o createNodeDefinition
  protected void createNodeDefinition(NodeDefinition def)
Create the node definition.
Overrides:
createNodeDefinition in class Node
 o initFields
  protected void initFields()
Initialize field values.
Overrides:
initFields in class Node
 o handleFieldChange
  protected void handleFieldChange(Field f)
Handle a field change.
Overrides:
handleFieldChange in class Node
 o getCachedBoundingBox
  public BoundingBox3 getCachedBoundingBox()
For BoundingBoxCachingNode.
 o recomputeBoundingBox
  public void recomputeBoundingBox(BoundingBox3 box)
Meant to be overridden by subclasses; compute the bounding box and store into the argument.
Overrides:
recomputeBoundingBox in class Node
 o boundingBoxHasChanged
  protected boolean boundingBoxHasChanged(Field f)
Meant to be overridden by subclasses.
Overrides:
boundingBoxHasChanged in class Node
 o handleGlobalPass
  public void handleGlobalPass(NodeInstance inst,
                               RenderState state,
                               Matrix4 objectToViewerMatrix)

All Packages  Class Hierarchy  This Package  Previous  Next  Index