org.sunflow.core
Class Camera
- RenderObject
public class Camera
extends java.lang.Object
This class represents a camera to the renderer. It handles the mapping of
camera space to world space, as well as the mounting of
CameraLens
objects which compute the actual projection.
Ray | getRay(float x, float y, int imageWidth, int imageHeight, double lensX, double lensY, double time) - Generate a ray passing though the specified point on the image plane.
|
boolean | update(ParameterList pl, SunflowAPI api) - Update this object given a list of parameters.
|
getRay
public Ray getRay(float x,
float y,
int imageWidth,
int imageHeight,
double lensX,
double lensY,
double time)
Generate a ray passing though the specified point on the image plane.
Additional random variables are provided for the lens to optionally
compute depth-of-field or motion blur effects. Note that the camera may
return null
for invalid arguments or for pixels which
don't project to anything.
x
- x pixel coordinatey
- y pixel coordinateimageWidth
- width of the image in pixelsimageHeight
- height of the image in pixelslensX
- a random variable in [0,1) to be used for DOF samplinglensY
- a random variable in [0,1) to be used for DOF samplingtime
- a random variable in [0,1) to be used for motion blur
sampling
- a ray passing through the specified pixel, or
null
update
public boolean update(ParameterList pl,
SunflowAPI api)
Update this object given a list of parameters. This method is guarenteed
to be called at least once on every object, but it should correctly
handle empty parameter lists. This means that the object should be in a
valid state from the time it is constructed. This method should also
return true or false depending on whether the update was succesfull or
not.
- update in interface RenderObject
pl
- list of parameters to read fromapi
- reference to the current scene
true
if the update is succesfull,
false
otherwise