Projection v VP u VPN n
Projection v VRP u VRP n Eye Point
Camera & World Up Vector Look At Vector
Orthographic Projection View Plane Back Clipping Plane VPN Front Clipping Plane
In OpenGL glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far) far The direction of projection is parallel to Z-axis. Looking at the negative direction near top left Back Clipping Plane VPN right bottom Front Clipping Plane
Perspective Projection View Plane Back Clipping Plane VPN Front Clipping Plane
In OpenGL glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far) far The direction of projection is parallel to Z-axis. Looking at the negative direction near top left VPN right Back Clipping Plane bottom Front Clipping Plane
In OpenGL gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble near, GLdouble far) far The direction of projection is parallel to Z-axis. Looking at the negative direction. Aspect = w/h near w VPN h Back Clipping Plane fovy Front Clipping Plane
gluLookAt gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble latx, GLdouble laty, GLdouble latz, GLdouble upx, GLdouble upy, GLdouble upz) The direction of projection is parallel to Z-axis. Looking at the negative direction. Aspect = w/h far near up w VPN h Back Clipping Plane fovy lat Front Clipping Plane
Parallel Projection
Parallel Projection (x,y,d) x z y (x,y,z) d (x,y,z) (x,y,d)
Perspective Projection
Perspective Projection xp=x(zprp – zvp)/ (zprp – z) View Plane yp=y(zprp – zvp)/ (zprp – z) (x,y,z) dp=(zprp – zvp) (xp,yp,zvp) zprp dp
Perspective Projection xp=x(zprp – zvp)/ (zprp – z) yp=y(zprp – zvp)/ (zprp – z) dp=(zprp – zvp) x y z 1 xh yh zh h 1 1 0 0 0 1 0 0 0 0 -zvp/dp zvp(zprp/dp) 0 0 -1/dp zprp/dp = h = (zprp-z/dp) xp=xh/h yp=yh/h
Graphics Pipeline Modeling Coordinates World Coordinates Viewing Transformation Viewing Transformation Viewing Coordinates Projection Coordinates Projection Transformation Normalization Transformation Normalized Projection Coordinates Device Coordinates Workstation Transformation