Class Project3DRay

java.lang.Object
  extended by Project3DRay

public class Project3DRay
extends java.lang.Object


Constructor Summary
Project3DRay()
           
 
Method Summary
static Interval1D getProjectedInterval(Ray3D r, Camera c)
          Projects the supplied Ray3D to the supplied Camera, which is assumed to be located in origo looking down the negative Z-axis.
static boolean isBackgroundColor(int color)
          Determines whether the supplied color is background or not.
static void printColor(int color)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project3DRay

public Project3DRay()
Method Detail

getProjectedInterval

public static Interval1D getProjectedInterval(Ray3D r,
                                              Camera c)
Projects the supplied Ray3D to the supplied Camera, which is assumed to be located in origo looking down the negative Z-axis. The method then computes which part of the ray that intersects the silhouette of the camera's image. If no part of the ray is contained within the silhouette, an empty interval is returned. In the current implementation, only single intervals are supported, limiting the objects to be convex.

Parameters:
r - the ray to project.
c - the camera to project to.
Returns:
the interval of the ray that is contained in the silhouette.

isBackgroundColor

public static boolean isBackgroundColor(int color)
Determines whether the supplied color is background or not. The color is considered background if its red component is in the interval [0, 10], its green component is in the interval [245, 255] and the blue component is in the interval [0, 10].

Parameters:
color - the color to test.
Returns:
true if the supplied color is a background color.

printColor

public static void printColor(int color)