Bouncy Castle Rendering Toolkit 1.0

org.bouncycastle.graphics.rt
Class MovingCamera

java.lang.Object
  |
  +--org.bouncycastle.graphics.rt.MovingCamera

public class MovingCamera
extends java.lang.Object


Constructor Summary
MovingCamera()
           
 
Method Summary
 void configureLenseMask(int samples, boolean jitter)
           
 Ray generateRay(int sampleNo, int time, float x, float y)
           
 void lookAt(Point3d[] eyes, Point3d[] refs, Vector3d[] ups)
          set the "look at" details for the camera.
 void lookAt(Point3d eye, Point3d ref, Vector3d up)
          set the "look at" details for the camera.
 void ortho(double left, double right, double bottom, double top, double near, double far)
          Define a three dimensional viewing box by giving the left, right, bottom and top clipping plane locations and the distances along the line of sight to the near and far clipping planes.
 void perspective(double fov)
          Specifiy a perspective projection for the image, with the near clipping plan at 0 and the far one at infinity.
 void perspective(double fov, double zNear, double zFar)
          Specify a perspective viewing pyramid in world coordinates by giving a field of view and the locations of the near(zNear) and far(zFar) clipping planes in the z direction.
 void setDepthOfField(double fStop, double focalLength, double focalDistance)
          In the normal situation with a real camera the diameter of the lense opening means that the camera is only capable of rendering objects sharply over a limited range of distances.
 void setTwist(double twist)
          set a twist about the line of sight.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MovingCamera

public MovingCamera()
Method Detail

lookAt

public void lookAt(Point3d eye,
                   Point3d ref,
                   Vector3d up)
set the "look at" details for the camera. The parameter eye represents the position of the observer, ref represents the position the observer is looking at, and up provides the direction of world up.
Parameters:
eye - the eye position.
ref - the point we are looking at.
up - the direction of world up.

lookAt

public void lookAt(Point3d[] eyes,
                   Point3d[] refs,
                   Vector3d[] ups)
set the "look at" details for the camera. In this case the camera is considered to be moving, and the eyes parameter gives the eye positions for the frame, with the refs and ups arrays providing the corresponding reference points and up vectors.
Parameters:
eyes - the eye positions.
refs - the corresponding reference positions.
ups - the corresponding up vectors.

setTwist

public void setTwist(double twist)
set a twist about the line of sight.
Parameters:
the - twist angle, in degrees.

setDepthOfField

public void setDepthOfField(double fStop,
                            double focalLength,
                            double focalDistance)
In the normal situation with a real camera the diameter of the lense opening means that the camera is only capable of rendering objects sharply over a limited range of distances. The smaller the opening the wider this range, or depth of field.

The default for a camera in our situation, is that it's a pin-hole and has an infinite depth of field. Finite depth of field, however, adds additional cues for depth perception, as well as adding an aesthetic touch to the image.

To add depth of field to an image we have to specify, a focal distance, a focal length, and the f-stop. The f-stop represents the size of the aperture admitting light into the camera, and the depth of field is determined by the ratio of the focal length to the f-stop and the focal distance.

Generaly the length units are millimeters, but in this case the units used are irrelevant, the units for focal length just need to be the same as for the focal distance.

Parameters:
fStop - the f-stop for the camera.
focalLength - the focal length of the lense.
focalDistance - distance at which objects will appear sharpest.

perspective

public void perspective(double fov)
Specifiy a perspective projection for the image, with the near clipping plan at 0 and the far one at infinity.
Parameters:
fov - the field of view.

perspective

public void perspective(double fov,
                        double zNear,
                        double zFar)
Specify a perspective viewing pyramid in world coordinates by giving a field of view and the locations of the near(zNear) and far(zFar) clipping planes in the z direction.
Parameters:
fov - the field of view.
zNear - the near clipping plan.
zFar - the far clipping plan.

ortho

public void ortho(double left,
                  double right,
                  double bottom,
                  double top,
                  double near,
                  double far)
Define a three dimensional viewing box by giving the left, right, bottom and top clipping plane locations and the distances along the line of sight to the near and far clipping planes.

configureLenseMask

public void configureLenseMask(int samples,
                               boolean jitter)

generateRay

public Ray generateRay(int sampleNo,
                       int time,
                       float x,
                       float y)

Bouncy Castle Rendering Toolkit 1.0