Computer Graphics

Lab Exercise 6: Parallel Projection I

This week we implement the first part of the camera model, though without hidden surface removal and without clipping. Back-face elimination is required.

Your program will be assessed as part of your coursework (10%).

An example of parallel projection can be seen below.


PerspectiveCamera.java
public class PerspectiveCamera extends Camera
{
  public Vector3D getVPN(){/*return the view plan normal vector*/}

  protected Point3D projectionTransform(final Point3D p){}

  public PerspectiveCamera(double xmin_, double xmax_, double ymin_, double ymax_){}

  public void setupCOP(Point3D cop_){}     

  private Point3D cop=new Point3D(0,0,-4); //centre of projection
}

A sample animation programme is supplied to you.

PerspectiveAnimator.java
public class PerspectiveAnimator extends ParallelAnimator
{
  protected void setupCamera()
  {
    camera= new PerspectiveCamera(-5,5,-5,5);
    ((PerspectiveCamera)camera).setupCOP(new Point3D(0,0,3));
  }

  public static void main(String[] args)
  { 
    new PerspectiveAnimator().loop();
  }
}