DOC PREVIEW
MIT 6 837 - Lecture Notes

This preview shows page 1-2-14-15-29-30 out of 30 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Lecture 8: 1 October 2002Today:Viewport CoordinatesPolygon Scan Conversion & FillingSubtleties of Floating Point vs. IntegerShadow RulesHidden Surface EliminationSpatial CoherenceThursday:Assignment 2 (*scene exhibition)Mysteries of homogeneous coordinates explainedAssignment 4 (Polygon fill with ivscan)postedFriday:Assignment 3 (Polygon wireframe rendering) due 5pmMIT 6.837 Computer Graphics Tuesday, 1 October 2002 (L8) Page 1Framebuffer and Discrete CoordinatesUsually “RGB” or “24-bit” or “full color” framebuffer2D array of xres × yres pixels (picture elements)RGB colordepth... depthyres xres At each pixel can be stored:Color (3 × 8 bit RGB = 24 bits, sometimes 36)Depth (b =24orb = 32 bits: values 0..2b− 1)Other attributes: α, stencil, window ID, etc.High-end machine may store > 200 bits per pixel!MIT 6.837 Computer Graphics Tuesday, 1 October 2002 (L8) Page 2Discretizing the Normalized View VolumeNDC parallelepiped is x = ±1, y = ±1, z = ±1Map this parallelepiped into 3D “device coordinates”Normalized Device Coordinates3D Screen Spacex1x2y1y2 xres yres0 xres−1 0 yres −1zres0 2b −1S(−1, −1, −1)(1, 1, 1)yxzx, y interval:range of values depends on framebuffer resolutiontypically specified as a rectangular “viewport”:(x1,y1)to(x2,y2)z interval:range of values depends on precision of (depth buffer)b bits: unsigned integer in range [0..2b− 1]MIT 6.837 Computer Graphics Tuesday, 1 October 2002 (L8) Page 3Viewport Transformation (first attempt)Pixel centers at integer coordinates; pixel (0, 0) at lower leftEasy: map x ∈ [−1.. +1]toxS∈ [x1..x2],and map y ∈ [−1.. +1]toyS∈ [y1..y2]x1x2y1y2 xres yres0 xres−1 0 yres −1Then:xS= x1+x+12(x2− x1)yS= y1+y+12(y2− y1)... Problem ?MIT 6.837 Computer Graphics Tuesday, 1 October 2002 (L8) Page 4Viewport Transformation (incorrect)This transform maps NDC extreme points to pixel centersxS= x1+x +12(x2− x1); yS= y1+y +12(y2− y1)Example:xS(−1) = x1+−1+12(x2− x1)=x1; yS(−1) = y1+−1+12(y2− y1)=y1x1x2y1y2Pixels have non-zero extent,which we must take into account!MIT 6.837 Computer Graphics Tuesday, 1 October 2002 (L8) Page 5Viewport Transformation (corrected)Accounting for pixel extents means mapping:x ∈ [−1.. +1]toxS∈ [x1−12..x2+12]y ∈ [−1.. +1]toyS∈ [y1−12..y2+12]0h−10w−1x1x2y1y2( x1 − 1/2, y1− 1/2 )( x2 + 1/2, y2 + 1/2 )xS= x1− 0.5+x +12(x2− x1+1)yS= y1− 0.5+y +12(y2− y1+1)Note: this is a floating point coordinate system!Depth (z ∈ [−1.. + 1]) is mapped linearly as:zS=z +12(2b− 1)MIT 6.837 Computer Graphics Tuesday, 1 October 2002 (L8) Page 6Viewport TransformationMatrix


View Full Document

MIT 6 837 - Lecture Notes

Documents in this Course
Shadows

Shadows

64 pages

Animation

Animation

37 pages

Radiosity

Radiosity

25 pages

Color

Color

86 pages

InterArch

InterArch

14 pages

Color

Color

15 pages

Animation

Animation

61 pages

Luxo Jr

Luxo Jr

14 pages

Animation

Animation

52 pages

Radiosity

Radiosity

37 pages

Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?