170 likes | 499 Views
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,
E N D
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 Back Clipping Plane h 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 Back Clipping Plane h fovy lat Front Clipping Plane
y x z Parallel Projection (x,y,d) (x,y,z) d (x,y,z) (x,y,d)
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 1 1 0 0 0 1 0 0 0 0 -zvp/dp zvp(zprp/dp) 0 0 -1/dp zprp/dp xh yh zh h = h = (zprp-z/dp) xp=xh/h yp=yh/h
Graphics Pipeline Modeling Coordinates World Coordinates Modeling Transformation Viewing Transformation Viewing Coordinates Projection Coordinates Projection Transformation Normalization Transformation Normalized Projection Coordinates Device Coordinates Workstation Transformation