DOC PREVIEW
UW-Madison CS 559 - CS 559 Lecture Notes

This preview shows page 1-2-16-17-18-33-34 out of 34 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 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 34 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 34 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 34 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 34 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 34 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 34 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Last TimeTodayPerspective ProjectionDistant Objects Are SmallerParallel lines meetVanishing pointsBasic Perspective ProjectionSlide 8Basic CaseSimple Perspective TransformationPerspective View VolumeClipping PlanesWhere is the Image Plane?Slide 14OpenGLPerspective Projection MatricesMapping LinesGeneral PerspectiveComplete Perspective ProjectionOpenGL Perspective ProjectionNear/Far and Depth ResolutionClippingSlide 23Clipping PointsPolygon-Rectangle Clipping (2D)Sutherland-Hodgman Clip (1)Sutherland-Hodgman Clip (2)Sutherland-Hodgman (3)Sutherland-Hodgman (4)Inside-Outside TestingSutherland-Hodgman (5)Inside/Outside in Screen SpaceAdditional Clipping PlanesOther Ways to Reject02/26/02(c) 2002 University of Wisconsin, CS 559Last Time•Canonical view pipeline•Orthographic projection–There was an error in the matrix for taking a simple orthographic volume and transforming it into the canonical view space–The slides now online are correct•In Shirley’s chapter on Transformation, note notation errors in the discussion of homogeneous coordinatesLocal Coordinate SpaceWorld Coordinate SpaceView Space3D Screen SpaceDisplay SpaceProjection02/26/02(c) 2002 University of Wisconsin, CS 559Today•Perspective viewing–Simple case–Completely general case02/26/02(c) 2002 University of Wisconsin, CS 559Perspective Projection•Abstract camera model - box with a small hole in it•Pinhole cameras work in practice - camera obscura, etc02/26/02(c) 2002 University of Wisconsin, CS 559Distant Objects Are Smaller02/26/02(c) 2002 University of Wisconsin, CS 559Parallel lines meetcommon to draw film planein front of the focal point02/26/02(c) 2002 University of Wisconsin, CS 559Vanishing points•Each set of parallel lines (=direction) meets at a different point: The vanishing point for this direction–Classic artistic perspective is 3-point persepctive•Sets of parallel lines on the same plane lead to collinear vanishing points: the horizon for that plane•Good way to spot faked images02/26/02(c) 2002 University of Wisconsin, CS 559Basic Perspective Projection•Assume you have transformed to view space, with x to the right, y up, and z back toward the viewer•Assume the origin of view space is at the center of projection•Define a focal distance, d, and put the image plane there (note d is negative)–This doesn’t quite fit into our viewing model, but we’ll come back to that02/26/02(c) 2002 University of Wisconsin, CS 559Basic Perspective Projection•If you know P(xv,yv,zv) and d, what is P(xs,ys)?–Where does a point in view space end up on the screen?xvyv-zvdP(xv,yv,zv)P(xs,ys)02/26/02(c) 2002 University of Wisconsin, CS 559Basic Case•Similar triangles gives:vvszxdxvvszydyyv-zvP(xv,yv,zv)P(xs,ys)View Planed02/26/02(c) 2002 University of Wisconsin, CS 559Simple Perspective Transformation•Using homogeneous coordinates we can write:dzzyxdyxvvvvssvsdPP010001000010000102/26/02(c) 2002 University of Wisconsin, CS 559Perspective View Volume•Recall the orthographic view volume, defined by a near, far, left, right, top and bottom plane•The perspective view volume is also defined by near, far, left, right, top and bottom planes – the clip planes–Near and far planes are parallel to the image plane: zv=n, zv=f–Other planes all pass through the center of projection (the origin of view space)–The left and right planes intersect the image plane in vertical lines–The top and bottom planes intersect in horizontal lines02/26/02(c) 2002 University of Wisconsin, CS 559Clipping Planesxv-zvNear Clip PlaneFar Clip PlaneView VolumeLeft ClipPlaneRight ClipPlanefnlr02/26/02(c) 2002 University of Wisconsin, CS 559Where is the Image Plane?•Notice that it doesn’t really matter where the image plane is located, once you define the view volume–You can move it forward and backward along the z axis and still get the same image, only scaled•But we need to know where it is to define the clipping planes–Assume the left/right/top/bottom planes are defined according to where they cut the near clip plane•Or, define the left/right and top/bottom clip planes by the field of view02/26/02(c) 2002 University of Wisconsin, CS 559Clipping Planesxv-zvNear Clip PlaneFar Clip PlaneView VolumeLeft ClipPlaneRight ClipPlanefFOV02/26/02(c) 2002 University of Wisconsin, CS 559OpenGL•gluPerspective(…)–Field of view in the y direction (vertical field-of-view)– Aspect ratio (should match window aspect ratio)–Near and far clipping planes–Defines a symmetric view volume•glFrustum(…)–Give the near and far clip plane, and places where the other clip planes cross the near plane–Defines the general case–Used for stereo viewing, mostly02/26/02(c) 2002 University of Wisconsin, CS 559Perspective Projection Matrices•We want a matrix that will take points in our perspective view volume and transform them into the orthographic view volume–This matrix will go in our pipeline just before the orthographic projection matrix(l,b,n)(r,t,n)(l,b,n)(r,t,n)02/26/02(c) 2002 University of Wisconsin, CS 559Mapping Lines•We want to map all the lines through the center of projection to parallel lines–Points on lines through the center of projection map to the same point on the image–Points on parallel lines map orthographically to the same point on the image–If we convert the perspective case to the orthographic case, we can use all our existing methods•The intersection points of lines with the near clip plane should not change •The matrix that does this, not surprisingly, looks like the matrix for our simple perspective case02/26/02(c) 2002 University of Wisconsin, CS 559General Perspective•This matrix leaves points with z=n unchanged•It is just like the simple projection matrix, but it does some extra things to z to map the depth properly•We can multiply a homogenous matrix by any number without changing the final point, so the two matrices above have the same effect 01000000000001000000100001nffnnnnfnfnPM02/26/02(c) 2002 University of Wisconsin, CS 559Complete Perspective Projection •After applying the perspective matrix, we still have to map the orthographic view volume to the canonical view volume:        


View Full Document

UW-Madison CS 559 - CS 559 Lecture Notes

Documents in this Course
Filters

Filters

14 pages

Lecture 2

Lecture 2

24 pages

Clipping

Clipping

22 pages

Modeling

Modeling

33 pages

Filters

Filters

26 pages

Dithering

Dithering

33 pages

Lecture 4

Lecture 4

20 pages

Load more
Download CS 559 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 CS 559 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 CS 559 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?