gnu.gleem
Interface ScreenToRayMapping

All Known Implementing Classes:
RightTruncPyrMapping

public interface ScreenToRayMapping

This interface defines the mapping from normalized screen coordinates to a 3D ray based on the given camera parameters. You could subclass it to allow for more types of camera frusta, but would also have to modify the CameraParameters structure.

The "normalized" screen coordinates must have the following properties:

upper left corner = (-1, 1)
lower left corner = (-1, -1)
lower right corner = (1, -1)
upper right corner = (1, 1)
center = (0, 0)

The application is responsible for specifying the window size to allow the ManipManager to compute these coordinates.


Method Summary
 void mapScreenToRay(Vec2f screenCoords, CameraParameters params, Vec3f raySource, Vec3f rayDirection)
          Maps screen (x, y) to 3D point source and direction based on given CameraParameters.
 

Method Detail

mapScreenToRay

public void mapScreenToRay(Vec2f screenCoords,
                           CameraParameters params,
                           Vec3f raySource,
                           Vec3f rayDirection)
Maps screen (x, y) to 3D point source and direction based on given CameraParameters. screenCoords and params are incoming arguments; raySource and rayDirection are mutated to contain the result.