Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

View.H File Reference

The fundamental unit for open GL rendering, supporting multiple Views, and cubic and stereographic projections. More...

#include <GL/glut.h>
#include <Screen.H>
#include <UserInterface.H>
#include <Picking.H>
#include <glModel.H>
#include <RGB.H>
#include <Morphology.H>

Go to the source code of this file.

Namespaces

namespace  xchen


Detailed Description

The fundamental unit for open GL rendering, supporting multiple Views, and cubic and stereographic projections.

A cubic projection is a special kind of perspective projection,with eye at origin. It has 6 viewing volume of 90 fov and 1.0 aspect ratio, one in each direction. The six images, with the configuration as below, are shown together in one View.

                         Top
                    Left Back Right Front
                         Bottom
 

A stereographic projection is another special kind of perspective projection, with eye at (0,0,1). And it only make senese if applied to a unit sphere in the orgin.

The configuration of a general perspective projection is eye at (0,0, eye_z), field of view fov, and aspect ratio is set automatically so that there is no distortion when mapped to the viewport in the screen.

Conceputally viewplane can be put anywhere before the eye, but is considered to be 1.0 distance from eye for convenience under whatever type of projection.

The viewplane is, height = 2.0 * tan(fov/2), width = width-height-ratio * height.

For orthographic projections, the viewplane is, height = 2.0 * zoom_out, width = width-height-ratio * height.

where zoom_out is, zoom_out = (eye_z-tz)/eye_z

This zoom effect, however, is applicable only to the transform control attached to a View object, not to that attached to a glModel object.

Eye_z is fixed at 1.0 for steregraphic projection, and at 0.0 for cubic projection. Eye_z is achieved by doing an extra translate_z(-eye_z) in addition to the user inputted viewing translation.

Methods are provided, for orthographic projections, to recover x and y coordinates of a 3D point P from the screen coordinates of P's image. Also for orthographic projections, methods are provided to compute the visual ray, originally (0,0,-1), after the rotation (rotating object can be identified to rotating the orthographic visual ray).

Multiple Views can be rendered simultaneously, and shown in different regions, i.e. viewports, of the whole display area, i.e. the screen. The viewport of each View is specified by GLViewPort if using absolute pixel value, or by XiaViewPort if normalized relative to the screen. A Viewplane is the same as its GLViewPort up to scale, because both use absolute measurements, one in 3D space and one in screen pixel. It is not, however, the same as its XiaViewPort, because the latter use normalized measurement.

Conceptually there are 5 different coordinate systems.

  1. World-Coordinates of the point P in 3D space.
  2. ViewPlane-Coordinates of P's projection on 2D view plane.
  3. Screen-Coordinates of P's image on window screen.
  4. Normalized-Coordinates-In-ViewPort of P's image relative to the GLViewPort where P's image is shown. And this is the same as,
  5. Normalized-Coordinates-In-Viewplane of P's projection onto Viewplan.
Author:
Xianming Chen
Computer Science Department
University of Utah
Date:
8 Jan 2004

Generated on Wed Apr 7 21:40:50 2004 by doxygen1.2.18