Class Camera

java.lang.Object
  extended by Camera
All Implemented Interfaces:
CloneableEx, java.lang.Cloneable, Persistent

public class Camera
extends java.lang.Object
implements Persistent, CloneableEx

A simple camera class for specifying the view into the scene.

Our 'camera' model is as follows. The center of the view plane is located at c = (cx, cy, cz). The view window (whose center is also c) is defined by two vectors u = (ux, uy, uz) and v = (vx, vy, vz) in the view plane:

view window = {c + au + bv | -1 <= a <= 1,-1 <= b <= 1} (the vectors u and v are assumed to be orthogonal).

The view reference point (eye) is located at c + e, with e = (ex, ey, ez).

Some things to note about our camera model:

}


Constructor Summary
Camera()
          Constructs a camera with a view window centered at the origin on the XY plane, with a width (x-axis) and height (y-axis) of 1, and the eye point at (0,0,1) looking down the negative z-axis.
Camera(javax.vecmath.Point3d viewCenter, javax.vecmath.Vector3d widthVector, javax.vecmath.Vector3d heightVector, javax.vecmath.Vector3d eyeVector)
          Constructs a camera with the specified parameters.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of the object.
 javax.vecmath.Vector3d getEyeVector()
          Returns the eyeVector.
 javax.vecmath.Vector3d getHeightVector()
          Returns the heightVector.
 javax.vecmath.Point3d getViewCenter()
          Returns the viewCenter.
 javax.vecmath.Vector3d getWidthVector()
          Returns the widthVector.
 void load(DataParser dataParser)
          Loads data using the DataParser object.
 void setEyeVector(javax.vecmath.Vector3d eyeVector)
          Sets the eyeVector.
 void setHeightVector(javax.vecmath.Vector3d heightVector)
          Sets the heightVector.
 void setViewCenter(javax.vecmath.Point3d viewCenter)
          Sets the viewCenter.
 void setWidthVector(javax.vecmath.Vector3d widthVector)
          Sets the widthVector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Camera

public Camera()
Constructs a camera with a view window centered at the origin on the XY plane, with a width (x-axis) and height (y-axis) of 1, and the eye point at (0,0,1) looking down the negative z-axis.


Camera

public Camera(javax.vecmath.Point3d viewCenter,
              javax.vecmath.Vector3d widthVector,
              javax.vecmath.Vector3d heightVector,
              javax.vecmath.Vector3d eyeVector)
Constructs a camera with the specified parameters.

Parameters:
viewCenter - The center of the view window.
widthVector - The vector from the viewCenter to positive horizontal edge of the view window.
heightVector - The vector from the viewCenter to positive vertical edge of the view window.
eyeVector - The vector from the viewCenter to the eye point.
Method Detail

clone

public java.lang.Object clone()
Description copied from interface: CloneableEx
Returns a copy of the object.

Specified by:
clone in interface CloneableEx
Overrides:
clone in class java.lang.Object
Returns:
A copy of the object.

load

public void load(DataParser dataParser)
Description copied from interface: Persistent
Loads data using the DataParser object.

A class overrides this function to load data that has been parsed.

Specified by:
load in interface Persistent
Parameters:
dataParser - The DataParser to load data from.

setViewCenter

public void setViewCenter(javax.vecmath.Point3d viewCenter)
Sets the viewCenter.

Parameters:
viewCenter - The viewCenter to set.

getViewCenter

public javax.vecmath.Point3d getViewCenter()
Returns the viewCenter.

Returns:
The viewCenter.

setWidthVector

public void setWidthVector(javax.vecmath.Vector3d widthVector)
Sets the widthVector.

Parameters:
widthVector - The widthVector to set.

getWidthVector

public javax.vecmath.Vector3d getWidthVector()
Returns the widthVector.

Returns:
The widthVector.

setHeightVector

public void setHeightVector(javax.vecmath.Vector3d heightVector)
Sets the heightVector.

Parameters:
heightVector - The heightVector to set.

getHeightVector

public javax.vecmath.Vector3d getHeightVector()
Returns the heightVector.

Returns:
The heightVector.

setEyeVector

public void setEyeVector(javax.vecmath.Vector3d eyeVector)
Sets the eyeVector.

Parameters:
eyeVector - The eyeVector to set.

getEyeVector

public javax.vecmath.Vector3d getEyeVector()
Returns the eyeVector.

Returns:
The eyeVector.