Rings
Version 0.3

threeD.raytracer.camera
Class ThinLensCamera

java.lang.Object
  extended bythreeD.raytracer.camera.OrthographicCamera
      extended bythreeD.raytracer.camera.PinholeCamera
          extended bythreeD.raytracer.camera.ThinLensCamera
All Implemented Interfaces:
Camera

public class ThinLensCamera
extends PinholeCamera

A ThinLensCamera object provides a camera with viewing rays that originate from a random point on a circular lens. By default the width and height of the projection are set to 0.036 by 0.024 and the focal length is set to 0.05. Also, the focus distance is set to 1.0 and the radius of the lens is set to 0.005 (default focal length / 10 to produce an f-number of 5).


Field Summary
 
Fields inherited from class threeD.raytracer.camera.OrthographicCamera
u, v
 
Constructor Summary
ThinLensCamera()
          Constructs a new ThinLensCamera object.
 
Method Summary
 double getFocalLength()
          Returns the focal length of this PinholeCamera object as a double value.
 double getFocus()
           
 double[] getFOV()
           
 double getLensRadius()
           
 double getProjectionHeight()
          Returns the projection height of this ThinLensCamera object as a double value.
 double getProjectionWidth()
          Returns the projection width of this ThinLensCamera object as a double value.
 Ray rayAt(double i, double j, int screenW, int screenH)
          Returns a Ray object that represents a line of sight from the camera represented by this PinholeCamera object.
 void setFocalLength(double focalLength)
          Sets the focal length used by this ThinLensCamera object.
 void setFocus(double focus)
          Sets the distance at which this ThinLensCamera object is focused.
 void setLensRadius(double radius)
          Sets the radius of the lens used by this ThinLensCamera object.
 void setProjectionDimensions(double w, double h)
          Sets the projection dimensions used by this ThinLensCamera object to the specified values.
 void setProjectionHeight(double h)
          Sets the projection height of this ThinLensCamera object to the specified projection height.
 void setProjectionWidth(double w)
          Sets the projection width of this ThinLensCamera object to the specified projection width.
protected  void updateProjectionDimensions()
           
 
Methods inherited from class threeD.raytracer.camera.OrthographicCamera
getLocation, getRotationMatrix, getUpDirection, getViewDirection, getViewingDirection, setLocation, setUpDirection, setViewDirection, setViewingDirection, updateUVW
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThinLensCamera

public ThinLensCamera()
Constructs a new ThinLensCamera object.

Method Detail

updateProjectionDimensions

protected void updateProjectionDimensions()

setProjectionDimensions

public void setProjectionDimensions(double w,
                                    double h)
Sets the projection dimensions used by this ThinLensCamera object to the specified values.

Overrides:
setProjectionDimensions in class OrthographicCamera

setProjectionWidth

public void setProjectionWidth(double w)
Sets the projection width of this ThinLensCamera object to the specified projection width.

Overrides:
setProjectionWidth in class OrthographicCamera

setProjectionHeight

public void setProjectionHeight(double h)
Sets the projection height of this ThinLensCamera object to the specified projection height.

Overrides:
setProjectionHeight in class OrthographicCamera

getProjectionWidth

public double getProjectionWidth()
Returns the projection width of this ThinLensCamera object as a double value.

Overrides:
getProjectionWidth in class OrthographicCamera

getProjectionHeight

public double getProjectionHeight()
Returns the projection height of this ThinLensCamera object as a double value.

Overrides:
getProjectionHeight in class OrthographicCamera

setFocalLength

public void setFocalLength(double focalLength)
Sets the focal length used by this ThinLensCamera object.

Overrides:
setFocalLength in class PinholeCamera
Parameters:
focalLength - The focalLength value to use.

setFocus

public void setFocus(double focus)
Sets the distance at which this ThinLensCamera object is focused.

Parameters:
focus - The focus distance to use.

setLensRadius

public void setLensRadius(double radius)
Sets the radius of the lens used by this ThinLensCamera object.

Parameters:
radius - The radius to use.

getFocus

public double getFocus()
Returns:
The distance at which this ThinLensCamera object is focused.

getFocalLength

public double getFocalLength()
Description copied from class: PinholeCamera
Returns the focal length of this PinholeCamera object as a double value.

Overrides:
getFocalLength in class PinholeCamera
Returns:
The focal length value used by this ThinLensCamera object.

getLensRadius

public double getLensRadius()
Returns:
The radius of the lens used by this ThinLensCamera object.

getFOV

public double[] getFOV()
Overrides:
getFOV in class PinholeCamera
Returns:
{Horizontal FOV, Vertical FOV} Measured in radians.

rayAt

public Ray rayAt(double i,
                 double j,
                 int screenW,
                 int screenH)
Description copied from class: PinholeCamera
Returns a Ray object that represents a line of sight from the camera represented by this PinholeCamera object. The first two parameters are the coordinates across the camera. These coordinates corespond to the pixels on the rendered image. The second two parameters specifiy the total integer width and height of the screen. Although the pixels on the screen must be in integer coordinates, this method provides the ability to create super high resolution images by allowing you to devote a single pixel to only a fraction of the theoretical camera surface. This effect can be used to produce large images from small scenes while retaining acuracy.

Specified by:
rayAt in interface Camera
Overrides:
rayAt in class PinholeCamera
Returns:
A ray that is in the same direction as the ray returned by the PinholeCamera, but with a position that is a random sample from a disk.

Rings
Version 0.3

Copyright 2003-05 Mike Murray