Wave-Field Rendering in Computational Holography: The Polygon ...
Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons...
-
Upload
delphia-allen -
Category
Documents
-
view
242 -
download
1
description
Transcript of Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons...
![Page 1: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/1.jpg)
Rendering Pipeline
Fall, 2013
![Page 2: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/2.jpg)
3D Polygon Rendering
Many applications use rendering of 3D polygons with direct illumination
![Page 3: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/3.jpg)
3D Polygon Rendering
What steps are necessary to utilize spatial coherence while drawing these polygons into a 2D image?
![Page 4: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/4.jpg)
3D Rendering Pipeline (for direct illumination)
Transform into 3D world coordinate system
Illuminate according to lighting and reflection
Transform into 3D camera coordinate system
Transform into 2D camera coordinate system
Clip primitives outside camera’s view
Transform into image coordinate system
Draw pixels (includes texturing, hidden surface, …)
![Page 5: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/5.jpg)
Transformations
![Page 6: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/6.jpg)
Viewing Transformations
![Page 7: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/7.jpg)
Viewing Transformation
Mapping from world to camera coordinates Eye position maps to origin Right vector maps to X axis Up vector maps to Y axis Back vector maps to Z axis
World X
Y
Z
![Page 8: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/8.jpg)
Camera Coordinates
Canonical coordinate system Convention is right-handed (looking down –z axis) Convenient for projection, clipping, etc .
![Page 9: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/9.jpg)
Finding the viewing transformation
We have the camera (in world coordinates) We want T taking objects from world to camera
Trick: find T-1 taking objects in camera to world
wc Tpp
cw pTp 1
![Page 10: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/10.jpg)
Finding the viewing transformation
Trick: map from camera coordinate to world Origin maps to eye position Z axis maps to Back vector Y axis maps to Up vector X axis maps to Right vector
This matrix is T-1 so we invert in to get T (easy)
![Page 11: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/11.jpg)
Viewing Transformations
![Page 12: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/12.jpg)
Projection
General definition: Transform points in n-space to m-space (m<n)
In computer Graphics: Map 3D camera coordinates to 2D screen coordinates
![Page 13: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/13.jpg)
Taxonomy of Projections
![Page 14: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/14.jpg)
Parallel Projection
Center of projections is at infinity Direction of projection (DOP) same for all points
![Page 15: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/15.jpg)
Orthogonal Projections
DOP perpendicular to view plane
![Page 16: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/16.jpg)
Oblique Projections
DOP not perpendicular to view plane1) Cavalier projection
• when angle between projector and view plane is 45 degree• foreshortening ratio for all three principal axis are equal.
2) Cabinet projection• the foreshortening ratio for edges that perpendicular to the
plane of projection is one-half (angle 63.43 degree )
perpendicular angle
Oblique angle
![Page 17: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/17.jpg)
Oblique Projections
DOP not perpendicular to view plane
![Page 18: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/18.jpg)
Parallel Projection View Volume
![Page 19: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/19.jpg)
Parallel Projection Matrix
General parallel projection transformation
![Page 20: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/20.jpg)
Perspective Projection
Map points onto “view plane” along “projectors” emanating from “center of projection” (COP)
![Page 21: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/21.jpg)
Perspective Projection
How many vanishing points?
![Page 22: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/22.jpg)
Perspective Projection View Volume
![Page 23: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/23.jpg)
Perspective Projection
Compute 2D coordinates from 3D coordinates with similar triangles
![Page 24: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/24.jpg)
Perspective Projection Matrix
4 x 4 matrix representation?
1
s
s
ccs
ccs
wDz
zDyy
zDxx
![Page 25: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/25.jpg)
Perspective Projection Matrix
4 x 4 matrix representation?
1
s
s
ccs
ccs
wDz
zDyy
zDxx
Dzw
zzyyxx
c
c
c
c
'
'''
![Page 26: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/26.jpg)
Perspective vs. Parallel
Parallel Projection+ Good for exact measurements+ Parallel lines remain parallel- Angles are not (in general) preserved- Less realistic looking
Perspective Projection+ Size varies inversely with distance – looks realistic- Distance and angles are not (in general) preserved- Parallel line do not (in general) remain parallel
![Page 27: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/27.jpg)
Classical Projections
![Page 28: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/28.jpg)
Taxonomy of Projections
![Page 29: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/29.jpg)
Viewing Transformations Summary
Camera Transformation Map 3D world coordinates to 3D camera coordinates Matrix has camera vectors are rows
Projection Transformation Map 3D camera coordinates to 2D screen coordinates Two type of projections
• Parallel • Perspective
![Page 30: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/30.jpg)
3D Rendering Pipeline (for direct illumination)
![Page 31: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/31.jpg)
2D Rendering Pipeline
Clip portions of geometric primitivesresiding outside the window
Transform the clipped primitives From screen to image coordinates
Fill pixels representing primitivesIn screen coordinates
![Page 32: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/32.jpg)
Clipping
Avoid drawing parts of primitives outside window Window defines part of scene being viewed Must draw geometric primitives only inside window
![Page 33: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/33.jpg)
Clipping
Avoid drawing parts of primitives outside window Points Lines Polygons Circles etc.
![Page 34: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/34.jpg)
Point Clipping
Is point (x, y) inside window?
![Page 35: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/35.jpg)
Line Clipping
Find the part of a line inside the clip window
![Page 36: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/36.jpg)
Cohen Sutherland Line Clipping
Use simple tests to classify easy cases first
![Page 37: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/37.jpg)
Cohen Sutherland Line Clipping
Classify some lines quickly AND of bit codes representing regions of two end points (must be 0)
![Page 38: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/38.jpg)
Cohen Sutherland Line Clipping
Compute intersections with window boundary for lines that can’t be classified quickly
![Page 39: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/39.jpg)
Cohen Sutherland Line Clipping
Compute intersections with window boundary for lines that can’t be classified quickly
![Page 40: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/40.jpg)
Cohen Sutherland Line Clipping
Compute intersections with window boundary for lines that can’t be classified quickly
![Page 41: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/41.jpg)
Polygon Clipping
Find the part of a polygon inside the clip window?
![Page 42: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/42.jpg)
Sutherland Hodgeman Clipping
Clip each window boundary one at a time
![Page 43: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/43.jpg)
Clipping to a Boundary
1. Do inside test for each point in sequence, 2. Insert new points when cross window boundary,3. Remove Points outside window boundary
![Page 44: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/44.jpg)
2D Rendering Pipeline
Clip portions of geometric primitivesresiding outside the window
Transform the clipped primitives From screen to image coordinates
Fill pixels representing primitivesIn screen coordinates
![Page 45: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/45.jpg)
Viewport Transformation
Transformation 2D geometric primitives from screen coordinate system (normalized device coordinates) to image coordinate system (pixels)
![Page 46: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/46.jpg)
Viewport Transformation
Window-to-Viewport mapping
![Page 47: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/47.jpg)
Summary of Transformations
![Page 48: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/48.jpg)
Summary
![Page 49: Rendering Pipeline Fall, 2013. 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1ae37f8b9ab0599782bc/html5/thumbnails/49.jpg)
Next Time