Projection: Introduction • 2D viewing simple: 1. Clip image to window 2. Map to view port • 3D more complex – Need to map 3D world to 2D window – Process called projection • View volume determines part of world to be mapped to 2D window – World clipped against VV – VV projected onto front plane of VV (projection plane, view plane) • General process: 3D world -→ coords specify VV 3D world -→ coords transform into canonical VV 3D transformed -→ world coords clip against canonical VV clipped transformed -→ world coords project onto projection plane 2D transformed -→ world coords transform window to view port device -→ coords • Projections defined in terms of 1. View reference point (VRP) 2. View plane normal (VPN) 3. View up vector (VUP) 4. Viewing reference coordinate system (VRC system) 5. Center of (viewing/projection) window (CW) 6. Projection reference point (PRP) 7. Center of projection (COP) 8. Direction of projection (DOP) 9. Type of projection 1
29
Embed
projection projection plane view planedjmoon/cgalgs/cgalgs...Projection: Specifying a View Volume (2) If projection is perspective, COP is PRP and sides of VV extend from PRP to edges
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Projection: Introduction
• 2D viewing simple:
1. Clip image to window
2. Map to view port
• 3D more complex
– Need to map 3D world to 2D window
– Process called projection
• View volume determines part of world to be mapped to 2D window
– World clipped against VV
– VV projected onto front plane of VV (projection plane, view plane)
• General process:
3D world−→coords
specifyVV
3D world−→coords
transforminto
canonical VV
3D transformed−→
world coords
clipagainst
canonical VV
clipped transformed−→
world coords
project ontoprojection
plane
2D transformed−→
world coords
transformwindow toview port
device−→coords
• Projections defined in terms of
1. View reference point (VRP)
2. View plane normal (VPN)
3. View up vector (VUP)
4. Viewing reference coordinate system (VRC system)
5. Center of (viewing/projection) window (CW)
6. Projection reference point (PRP)
7. Center of projection (COP)
8. Direction of projection (DOP)
9. Type of projection
1
Projection: Specifying a Coordinate System for Viewing
• View plane
– Defined by VRP and VPN
– VP contains VRP and is normal to VPN
– Defined in world coords
– (Cf gluLookAt)
• VRC system
– Defines a coord system with which to specify projection window
– Origin is VRP
– n axis is VPN
– v axis is projection of VUP onto view plane
V UP × V PN 6= 0
– u axis orthogonal to n and v
– u, n, and v form right-handed coord system
– To generate:
1. n axis is VPN
2. u = V UP × V PN3. v = n× u
2
Projection: Specifying a Coordinate System for Viewing (2)
• Viewing window
– Defined in terms of umin, umax, vmin, vmax
– Window does not have to be symmetric wrt VRP
– In general, CW 6≡ V RP
3
Projection: Specifying a View Volume
• Specified wrt VRC system
• PRP defines DOP:
1. Defined in terms of VRC
2. DOP is vector from PRP to CW
• If projection is parallel, sides of VV parallel to DOP: infinite parallelpiped
4
Projection: Specifying a View Volume (2)
• If projection is perspective, COP is PRP and sides of VV extend from PRP toedges of viewing window: pyramid
• Near and far (hither and yon) clip planes specified as distances from the VPalong n axis
– Positive values are in direction of VPN
near > far (or VV will be empty)
• Parallel VV: finite parallelpiped
• Perspective VV: truncated pyramid (frustum)
5
Projection: Simple Planar Geometric Projections
• Only simple projection considered here
– More complex situations will be transformed into simple cases (discussedlater)
1. Perspective
(a) Case 1
• VP normal to z axis
• VP located at z = d
• COP at origin
• Point p(x, y, z)) projected onto point pp(xp, yp, zp)