public class DistantLight extends AbstractLight
Modifier and Type | Field and Description |
---|---|
private double |
azimuth
The azimuth of the distant light, i.e., the angle of the light vector
on the (X, Y) plane
|
private double |
elevation
The elevation of the distant light, i.e., the angle of the light
vector on the (X, Z) plane.
|
private double |
Lx
Light vector
|
private double |
Ly
Light vector
|
private double |
Lz
Light vector
|
Constructor and Description |
---|
DistantLight(double azimuth,
double elevation,
java.awt.Color color) |
Modifier and Type | Method and Description |
---|---|
double |
getAzimuth() |
double |
getElevation() |
void |
getLight(double x,
double y,
double z,
double[] L)
Computes the light vector in (x, y)
|
double[][] |
getLightRow(double x,
double y,
double dx,
int width,
double[][] z,
double[][] lightRow)
Returns a row of the light map, starting at (x, y) with dx
increments, a given width, and z elevations stored in the
fourth component on the N array.
|
boolean |
isConstant() |
getColor, getLightMap, setColor, sRGBToLsRGB
private double azimuth
private double elevation
private double Lx
private double Ly
private double Lz
public DistantLight(double azimuth, double elevation, java.awt.Color color)
public double getAzimuth()
public double getElevation()
public boolean isConstant()
isConstant
in interface Light
isConstant
in class AbstractLight
public void getLight(double x, double y, double z, double[] L)
x
- x-axis coordinate where the light should be computedy
- y-axis coordinate where the light should be computedL
- array of length 3 where the result is storedz
- z-axis coordinate where the light should be computedpublic double[][] getLightRow(double x, double y, double dx, int width, double[][] z, double[][] lightRow)
getLightRow
in interface Light
getLightRow
in class AbstractLight
x
- x-axis coordinate where the light should be computedy
- y-axis coordinate where the light should be computeddx
- delta x for computing light vectors in user spacewidth
- number of samples to compute on the x axisz
- array containing the z elevation for all the pointslightRow
- array to store the light info to, if null it will
be allocated for you and returned.