Projection v VP u VPN n Projection v
- Slides: 15
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 Open. GL gl. Ortho(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 botto right m Front Clipping Plane Back Clipping Plane
Perspective Projection View Plane Back Clipping Plane VPN Front Clipping Plane
In Open. GL gl. Frustum(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 VPN top left botto m right Front Clipping Plane Back Clipping Plane
In Open. GL glu. Perspective(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 fovy h Front Clipping Plane Back Clipping Plane
glu. Look. At(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 lat fovy h Front Clipping Plane Back Clipping Plane
Parallel Projection
Parallel Projection y (x, y, z) (x, y, d) x z d (x, y, z) (x, y, d)
Perspective Projection
Perspective Projection xp=x(zprp – zvp)/ (zprp – z) (x, y, z) View Plane yp=y(zprp – zvp)/ (zprp – z) dp=(zprp – zvp) (xp, yp, zvp) dp zprp
Perspective Projection xp=x(zprp – zvp)/ (zprp – z) yp=y(zprp – zvp)/ (zprp – z) dp=(zprp – zvp) xh yh zh h = 1 0 0 0 h = (zprp-z/dp) xp=xh/h yp=yh/h 1 0 0 -zvp/dp 0 -1/dp 0 0 zvp(zprp/dp) zprp/dp x y z 1
Graphics Pipeline Modeling Coordinates Modeling Transformation World Coordinates Viewing Transformation Viewing Coordinates Projection Transformation Projection Coordinates Normalization Transformation Normalized Projection Coordinates Workstation Transformation Device Coordinates