raytracer
Class Camera

java.lang.Object
  extended by raytracer.Camera

public class Camera
extends java.lang.Object


Constructor Summary
Camera(Point3D eyepoint_, Vector3D direction_, Vector3D up_, double fov_)
          constructor
 
Method Summary
 Ray generateRay(double i, double j)
          generates a ray from the eyepoint through the pixel coordinates i,j
 int getDimX()
           
 int getDimY()
           
 Point3D getEyePoint()
           
 void move(Vector3D v)
          translate the object with vector v
 void rotate(Vector3D v, double alpha)
          rotate around vector v with angle alpha
 void rotateAroundX(double alpha)
          rotate around the x axis with angle alpha
 void rotateAroundY(double beta)
          rotate around the y axis with angle beta
 void rotateAroundZ(double gamma)
          rotate around the z axis with angle gamma
 void setResolution(int dimx_, int dimy_)
           
 void transform(TransformationMatrix4x4 tm)
          transforms the camera
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Camera

public Camera(Point3D eyepoint_,
              Vector3D direction_,
              Vector3D up_,
              double fov_)
constructor

Parameters:
eyepoint_ - the point, the camera is located
direction_ - the camera points into that direction
up_ - the vector pointing upwards
fov_ - field of view
Method Detail

setResolution

public void setResolution(int dimx_,
                          int dimy_)
Parameters:
dimx_ - the x dimension
dimy_ - the y dimension

getDimX

public int getDimX()
Returns:
the x dimension

getDimY

public int getDimY()
Returns:
the y dimension

transform

public void transform(TransformationMatrix4x4 tm)
transforms the camera

Parameters:
tm - transformation matrix

generateRay

public Ray generateRay(double i,
                       double j)
generates a ray from the eyepoint through the pixel coordinates i,j

Parameters:
i - the horizontal pixel coordinate
j - the vertical pixel coordinate
Returns:
ray

getEyePoint

public Point3D getEyePoint()
Returns:
eyepoint

move

public void move(Vector3D v)
translate the object with vector v

Parameters:
v - translation vector

rotate

public void rotate(Vector3D v,
                   double alpha)
rotate around vector v with angle alpha

Parameters:
v - vector
alpha - angle

rotateAroundX

public void rotateAroundX(double alpha)
rotate around the x axis with angle alpha

Parameters:
alpha - angle

rotateAroundY

public void rotateAroundY(double beta)
rotate around the y axis with angle beta

Parameters:
beta - angle

rotateAroundZ

public void rotateAroundZ(double gamma)
rotate around the z axis with angle gamma

Parameters:
gamma - angle