Jazz3D API


com.sygem.jazz3d3
Class Light

java.lang.Object
  |
  +--com.sygem.jazz3d3.Light
Direct Known Subclasses:
Lightpoint, Lightspot

public class Light
extends java.lang.Object

A basic light type. This represents a light which has no position in space, it just shines in a given direction.

Effectively, this light is infinitely far away, and shines across space, never losing intensity. This is the fastest of the light sources.

Version:
3.0a
Author:
SyGem Software
See Also:
Lightpoint, Lightspot

Constructor Summary
Light(double x, double y, double z)
          Default constructor.
 
Method Summary
 void pointAt(double x, double y, double z)
          Point the light source at a point.
 void rotate(double xa, double ya, double za)
          Rotate the light source.
 void rotate(double xa, double ya, double za, double px, double py, double pz)
          Rotate the light source around another point.
 void setColour(int red, int green, int blue)
          Sets the colour of the light.
 void setIntensity(double intensity)
          Sets the intensity of the light.
 void translate(double xd, double yd, double zd)
          Moves the light source.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Light

public Light(double x,
             double y,
             double z)
Default constructor. The parameters represent the direction the light is to shine in.
Parameters:
x - The x component of the light direction
y - The y component of the light direction
z - The z component of the light direction
Method Detail

setIntensity

public void setIntensity(double intensity)
Sets the intensity of the light.
Parameters:
intensity - A value from 0 to 1.

setColour

public final void setColour(int red,
                            int green,
                            int blue)
Sets the colour of the light.
Parameters:
red - The red value of the colour. Ranges from 0 to 255.
green - The green value of the colour. Ranges from 0 to 255.
blue - The blue value of the colour. Ranges from 0 to 255.

translate

public void translate(double xd,
                      double yd,
                      double zd)
Moves the light source. Note that this has no effect for this type of light source, since it has no position to move from.
Parameters:
xd - The amount to move along the x-axis.
yd - The amount to move along the y-axis.
zd - The amount to move along the z-axis.

rotate

public void rotate(double xa,
                   double ya,
                   double za)
Rotate the light source.
Parameters:
xa - The amount to rotate around the x-axis.
ya - The amount to rotate around the y-axis.
za - The amount to rotate around the z-axis.

rotate

public void rotate(double xa,
                   double ya,
                   double za,
                   double px,
                   double py,
                   double pz)
Rotate the light source around another point.
Parameters:
xa - The amount to rotate around the x-axis.
ya - The amount to rotate around the y-axis.
za - The amount to rotate around the z-axis.
px - The x coordinate of the point to rotate around.
py - The y coordinate of the point to rotate around.
pz - The z coordinate of the point to rotate around.

pointAt

public void pointAt(double x,
                    double y,
                    double z)
Point the light source at a point. Note that this has no effect for this type of light source, since it has no position to point from.
Parameters:
x - The x coordinate of the point to point at.
y - The y coordinate of the point to point at.
z - The z coordinate of the point to point at.

©2001 SyGem Software