cz.cuni.jagrlib.iface
Interface RayGenerator

All Superinterfaces:
Property
All Known Implementing Classes:
StaticCamera

public interface RayGenerator
extends Property

Generator of 3D rays (projection transformation, camera).

Since:
0.11
See Also:
RayGenerator.java, RTScene

Field Summary
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 boolean getRay(double x, double y, double[] P0, double[] P1)
          Ray-generator method.
 boolean getRay(double x, double y, int order, int total, double[] P0, double[] P1)
          Ray-generator method.
 double[] getViewport(double[] pre)
          Returns boundary values for projection-plane coordinates (ray-coordinates).
 void setAspectRatio(double aspect)
          Sets aspect ratio of the target image.
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Method Detail

setAspectRatio

void setAspectRatio(double aspect)
Sets aspect ratio of the target image. Default aspect ratio (if not set) should be 4/3.

Parameters:
aspect - Aspect ratio = width / height. Uses real coordinates.

getViewport

double[] getViewport(double[] pre)
Returns boundary values for projection-plane coordinates (ray-coordinates).

Parameters:
pre - Pre-allocated array to hold results (double[4] array). Can be null.
Returns:
X and Y coordinate bounds: result[0] .. Xmin, result[1] .. Xmax, result[2] .. Ymin, result[3] .. Ymax.
See Also:
getRay(double, double, double[], double[])

getRay

boolean getRay(double x,
               double y,
               double[] P0,
               double[] P1)
Ray-generator method.

Parameters:
x - X coordinate in the projection plane.
y - Y coordinate in the projection plane.
P0 - Pre-allocated double[3] (or double[4]) array to hold coordinates of the ray origin.
P1 - Pre-allocated double[3] (or double[4]) array to hold direction vector of the ray.
Returns:
true if the ray was successfully generated.

getRay

boolean getRay(double x,
               double y,
               int order,
               int total,
               double[] P0,
               double[] P1)
Ray-generator method. Passes parameters for hidden sampling.

Parameters:
x - X coordinate in the projection plane.
y - Y coordinate in the projection plane.
order - Order of this sample inside the actual pixel.
total - Total number of samples in the actual pixel.
P0 - Pre-allocated double[3] (or double[4]) array to hold coordinates of the ray origin.
P1 - Pre-allocated double[3] (or double[4]) array to hold direction vector of the ray.
Returns:
true if the ray was successfully generated.