|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.vecmath.Tuple3d de.grogra.ray.physics.Spectrum3d de.grogra.ray.physics.CollectorW3d
public class CollectorW3d
This class stores some useful information about incoming rays of an
corresponding object, which has received a certain ray. This class extended
all properties of Spectrum3d
. It means that this Collector is
also a Spectrum
.
This is an implementation for calculation statics of the West Algorithm.
For more information see http://doi.acm.org/10.1145/359146.359152
.
To calculate the elements of statistic:
Q = X - M
R = Q/rayCount
M = M + R
T = T +(rayCount - 1) * Q * R
Field Summary | |
---|---|
protected boolean |
asCollector
|
protected double |
MDirectionX
|
protected double |
MDirectionY
|
protected double |
MDirectionZ
|
protected double |
MSpectrumX
|
protected double |
MSpectrumY
|
protected double |
MSpectrumZ
|
protected long |
rayCount
|
protected double |
TDirectionX
|
protected double |
TDirectionY
|
protected double |
TDirectionZ
|
protected double |
TSpectrumX
|
protected double |
TSpectrumY
|
protected double |
TSpectrumZ
|
Fields inherited from class javax.vecmath.Tuple3d |
---|
x, y, z |
Constructor Summary | |
---|---|
CollectorW3d()
Just a new instance of this class. |
|
CollectorW3d(double x,
double y,
double z)
This constructor creates a Collector-instance with a certain Spectrum . |
|
CollectorW3d(Spectrum spectrum)
This constructor creates a Collector-instance with a certain Spectrum . |
Method Summary | |
---|---|
void |
add(Collector col)
To combine two Collector-instances. |
void |
add(Spectrum spectrum)
Add the newSpectrum to the spectrum of this Collector-instance and update the statistics. |
void |
addToStatistic(Tuple3d rayOrigin,
Spectrum3d spectrum,
double scaleFactor,
boolean isPrimary)
Add the Vector of the origin of a certain ray, which hits the object for this corresponding Collector-instance. |
void |
addToStatistic(Tuple3d rayOrigin,
Spectrum spectrum,
double scaleFactor,
boolean isPrimary)
Here the information of LightModel computation are stored. |
Collector3d |
clone()
Creates a copy of the Spectrum or a deep-copy of this instance. |
void |
getCollectedValues(Tuple3d sumDir,
Tuple3d sumSquareDir,
Tuple3d sumSpec,
Tuple3d sumSquareSpec)
|
void |
getDirectionArithmeticMean(Tuple3d tuple)
Set the arithmetic mean of all directions (not normalized) to vector . |
void |
getDirectionArithmeticMean(Tuple3f tuple)
|
void |
getDirectionVariance(Tuple3d tuple)
This methods returns the variance of the light-direction (not normalized). |
void |
getDirectionVariance(Tuple3f tuple)
|
long |
getRayCount()
Returns the number of rays which hit the corresponding object of this instance. |
void |
getSpectrumArithmeticMean(Spectrum spectrum)
Set the arithmetic mean of all spectra to spectrum . |
void |
getSpectrumVariance(Spectrum spectrum)
This methods returns the variance of the spectrums. |
boolean |
isCollector()
If the collector should works like a Spectrum, this method returns false, otherwise true. |
Collector3d |
newInstance()
Returns a new instance of this class. |
static void |
normalize(Tuple3d t)
|
static void |
normalize(Tuple3f t)
|
void |
setAsCollector()
The initial value of asCollector is false. |
void |
setZero()
Sets all values the instance to zero. |
Methods inherited from class de.grogra.ray.physics.Spectrum3d |
---|
clampMinZero, div, div, div, dot, evaluateDouble, get, getMax, integrate, mul, mul, mul, set, setIdentity, sub, sum |
Methods inherited from class javax.vecmath.Tuple3d |
---|
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, epsilonEquals, equals, equals, get, get, hashCode, interpolate, interpolate, max, min, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.grogra.ray.physics.Spectrum |
---|
clampMinZero, div, div, div, dot, evaluateDouble, get, get, getMax, integrate, mul, mul, mul, scale, set, set, set, setIdentity, sub, sum |
Field Detail |
---|
protected boolean asCollector
protected double MDirectionX
protected double MDirectionY
protected double MDirectionZ
protected double MSpectrumX
protected double MSpectrumY
protected double MSpectrumZ
protected long rayCount
protected double TDirectionX
protected double TDirectionY
protected double TDirectionZ
protected double TSpectrumX
protected double TSpectrumY
protected double TSpectrumZ
Constructor Detail |
---|
public CollectorW3d()
public CollectorW3d(double x, double y, double z)
Spectrum
.
x
- Red-component of Spectrum3d
y
- Green-component of Spectrum3d
z
- Blue-component of Spectrum3d
public CollectorW3d(Spectrum spectrum)
Spectrum
.
spectrum
- Spectrum, which is used by the LightModelMethod Detail |
---|
public void add(Collector col)
col
added to the values of this instance.
add
in interface Collector
col
- To added Collector-instance.public void add(Spectrum spectrum)
add
in interface Spectrum
add
in class Spectrum3d
newSpectrum
- New to added spectrum.public void addToStatistic(Tuple3d rayOrigin, Spectrum3d spectrum, double scaleFactor, boolean isPrimary)
rayOrigin
- Where the light comes from.scale
- The factor for weighting this direction (usually intensity of incoming light)public void addToStatistic(Tuple3d rayOrigin, Spectrum spectrum, double scaleFactor, boolean isPrimary)
Collector
LightModel
computation are stored.
addToStatistic
in interface Collector
rayOrigin
- May this contains a certain vector (direction for example).spectrum
- To added Spectrum
.scaleFactor
- For the added Spectrum
.isPrimary
- To distinguish from primary or secondary rays.public Collector3d clone()
clone
in interface Collector
clone
in interface Spectrum
clone
in class Spectrum3d
public void getCollectedValues(Tuple3d sumDir, Tuple3d sumSquareDir, Tuple3d sumSpec, Tuple3d sumSquareSpec)
getCollectedValues
in interface Collector
public void getDirectionArithmeticMean(Tuple3d tuple)
vector
.
The parameter vector
should be initialized before.
getDirectionArithmeticMean
in interface Collector
vector
- Returns the arithmetic mean of all direction
for this Collector-instance.public void getDirectionArithmeticMean(Tuple3f tuple)
public void getDirectionVariance(Tuple3d tuple)
getDirectionVariance
in interface Collector
public void getDirectionVariance(Tuple3f tuple)
public long getRayCount()
getRayCount
in interface Collector
public void getSpectrumArithmeticMean(Spectrum spectrum)
spectrum
.
The parameter spectrum
should be initialized before.
getSpectrumArithmeticMean
in interface Collector
spectrum
- Returns the arithmetic mean of all spectra
for this Collector-instance.public void getSpectrumVariance(Spectrum spectrum)
getSpectrumVariance
in interface Collector
public boolean isCollector()
isCollector
in interface Collector
public Collector3d newInstance()
newInstance
in interface Collector
newInstance
in interface Spectrum
newInstance
in class Spectrum3d
public static void normalize(Tuple3d t)
public static void normalize(Tuple3f t)
public void setAsCollector()
asCollector
is false. It means
that the collector works like a Spectrum
. Thats useful
when this Collector-instance is used for the calculations in
LightModel
.
setAsCollector
in interface Collector
public void setZero()
LightModel
computation.
setZero
in interface Spectrum
setZero
in class Spectrum3d
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |