|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectthreeD.raytracer.camera.OrthographicCamera
threeD.raytracer.camera.PinholeCamera
A PinholeCamera object represents a camera in 3D. A PinholeCamera object stores the location, viewing direction, up direction, focal length, and projection dimensions which are used for rendering. When constructing a PinholeCamera object you must make these specifications carefully. The camera location is, as expected, the location from which the camera views, represented as a vector. This value is by default at the origin. The viewing direction is a vector that represents the direction the camera is viewing. This value is by default aligned to the positive z axis, or (0.0, 0.0, 1.0). The up direction is a vector that represents the orientation of the camera's "up." This value is by default aligned with the positive y axis or (0.0, 1.0, 0.0). The focal length of the camera can be thought of as the distance from the camera location to the projection. The focal length is also the tangent of half the vertical field of view. The projection dimensions are the dimensions of the projection that the camera will produce. By default the projection dimensions are set to 0.36 by 0.24 to produce a 35mm film aspect ratio. A Camera object also stores three perpendicular vectors that describe a coordinate system. This is the camera coordinate system and is used for projection. These vectors are computed and updated automatically based on the viewing direction and up direction vectors.
| Field Summary |
| Fields inherited from class threeD.raytracer.camera.OrthographicCamera |
u, v, w |
| Constructor Summary | |
PinholeCamera()
Constructs a PinholeCamera object with all default values as described above. |
|
PinholeCamera(Vector location,
Vector viewDirection,
Vector upDirection)
Constructs a PinholeCamera object with the specified location, viewing direction, and up direction, but with default focal length and projection dimensions as specified above. |
|
PinholeCamera(Vector location,
Vector viewDirection,
Vector upDirection,
double focalLength,
double[] fov)
Constructs a PinholeCamera object with the specified location, viewing direction, up direction, and focal length. |
|
PinholeCamera(Vector location,
Vector viewDirection,
Vector upDirection,
double focalLength,
double projectionX,
double projectionY)
Constructs a PinholeCamera object with the specified location, viewing direction, up direction, focal length, and projection dimensions. |
|
| Method Summary | |
double |
getFocalLength()
Returns the focal length of this PinholeCamera object as a double value. |
double[] |
getFOV()
|
Ray |
rayAt(double i,
double j,
int screenWidth,
int screenHeight)
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 of this PinholeCamera object to the specified focal length. |
| Methods inherited from class threeD.raytracer.camera.OrthographicCamera |
getLocation, getProjectionHeight, getProjectionWidth, getRotationMatrix, getUpDirection, getViewDirection, getViewingDirection, setLocation, setProjectionDimensions, setProjectionHeight, setProjectionWidth, setUpDirection, setViewDirection, setViewingDirection, updateUVW |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PinholeCamera()
public PinholeCamera(Vector location,
Vector viewDirection,
Vector upDirection)
public PinholeCamera(Vector location,
Vector viewDirection,
Vector upDirection,
double focalLength,
double projectionX,
double projectionY)
public PinholeCamera(Vector location,
Vector viewDirection,
Vector upDirection,
double focalLength,
double[] fov)
location - Camera location.upDirection - Camera up direction.focalLength - Camera focal length.fov - Camera fields of view (radians) {horizontal FOV, vertical FOV}.| Method Detail |
public void setFocalLength(double focalLength)
public double getFocalLength()
public double[] getFOV()
public Ray rayAt(double i,
double j,
int screenWidth,
int screenHeight)
rayAt in interface CamerarayAt in class OrthographicCameraCamera.rayAt(double, double, int, int)
|
Rings Version 0.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||