Class TransformUtility

java.lang.Object
  extended by TransformUtility

public class TransformUtility
extends java.lang.Object

A set of utility methods for generating transformation matrices of interest.


Method Summary
static Transform orthographicProjection(double x0, double x1, double y0, double y1, double N, double F)
          Creates a projection matrix transforming the rectangular view volume into the standard cube.
static Transform perspectiveProjection(double x0, double x1, double y0, double y1, double N, double F)
          Creates a projection matrix transforming a frustum view volume into the standard cube.
static Transform viewTransform(Point eye, Point look, Vector up)
          Creates a transformation for switching from world coordinates to view coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

viewTransform

public static Transform viewTransform(Point eye,
                                      Point look,
                                      Vector up)
Creates a transformation for switching from world coordinates to view coordinates. The view is based at the given location eye, facing toward the locaion look, with the up vector specifying which direction the top of the screen is from eye. Note that all three parameters are specified in world coordinates.


orthographicProjection

public static Transform orthographicProjection(double x0,
                                               double x1,
                                               double y0,
                                               double y1,
                                               double N,
                                               double F)
Creates a projection matrix transforming the rectangular view volume into the standard cube. The view volume is a rectangular solid aligned with the view coordinates' axes, and it is specified by the range of x-coordinates [x0,x1], the range of y-coordinates [y0,y1], and the range of z-coordinates [N,F].


perspectiveProjection

public static Transform perspectiveProjection(double x0,
                                              double x1,
                                              double y0,
                                              double y1,
                                              double N,
                                              double F)
Creates a projection matrix transforming a frustum view volume into the standard cube. The view volume is a truncated pyramid proceeding along the z-axis. The pyramid has its base at -F, and its peak at the origin, but the peak is truncated off with a plane parallel to the base at the z-coordinate -N. The width and breadth of the frustum is specified through the size of the pyramid's slice with the near plane. In particular, that slice is a rectangle covering the range of x-coordinates [x0,x1] and the range of y-coordinates [y0,y1].