Introduction to Computer GraphicsFarhana Bandukwala, PhDLecture 10: ProjectionsOutline• Viewing 3D world on 2D displays• Perspective projection• Parallel projection• Cameras and clipping planesViewing 3D World on 2D plane• To view 3D, need to project points onto 2D view plane• Scene or view volume • Window: projection plane• Viewport: display plane• Projection: intersection of projectors w/window• Center of projection: focal point for all projectorswindowview volumeprojectorsxzyview coordinatescenter ofprojectionTerminology• Projection plane = view plane– Defined by view reference point (VRP) in world coordinates and view-plane normal (VPN)• Viewing reference coordinate (VRC) system defined on view plane with VRP as origin– VPN is one axis, view-up vector (VUP) is another, and third is perpendicular to plane containing the VUP & VPN• Window: defines extents on view plane that are within display’s viewport using VRC– Center of window (CW) not necessarily at VRP• Center of projection (COP) specified in VRC – COP does not change with respect to VRP even if view plane is moved in the world coordinate systemDiagram of view plane termszxyviewplaneVPNVRPCW(xmin,ymin)(xmax,ymax)center of projection (COP)Defining camera position• Camera center at VRP in world coordinates• Orientation: given by VPN (perpendicular to camera back plane) and VUP vectors• Open GL: using gluLookAt()– Specify eye point (VRP)– Specify “at” point, which together w/VRP defines VPN– Specify VUP vectorxzyworld coordinatesview volumeEye point = VRPat pointVPNVUPClipping planesView volume extents defined by near (front) and far (back) clipping planesviewplaneFront clippingplaneback clippingplanecenter of projectionPerspective projection• Parallel lines in world converge to vanishing point• Possible to have a vanishing point per axis• Vanishing point when window intersects axis• Usually 1 or 2 vanishing points per projectionzyxz-axis vanishing point2-Point perspectivezyxPerpective Projection & Homogenous coordinateszyx(x,y,z)(xp,yp,zp=d)(x, z)zx(xp, zp=d)dxzxp=pxdzx=/Yz(yp, zp=d)dyzyp=pydzy=/(y, z)1*0/100010000100001zyxd=dzzyx/Now project to w=1 planeGives us our projected coordinatesParallel projections• Projectors are parallel to direction of projection• Center of Projection is at infinity (parallel projectors)• Orthographic: – projection plane perpendicular to an axis– Parallel lines, distances and angles are preserved• Oblique: – projection direction is NOT parallel to an axis– Parallel lines, distances along principal axis preservedorthographicobliquexp=x & yp=y &
View Full Document