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

This preview shows page 1-2-15-16-31-32 out of 32 pages.

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

Unformatted text preview:

Last TimeTodayReviewOpenGL CameraTypical View Spec. UsageLeft vs Right Handed View SpacePerspective ProjectionDistant Objects Are SmallerParallel lines meetVanishing pointsBasic Perspective ProjectionSlide 12Basic CaseSimple Perspective TransformationParallel Lines Meet?General PerspectivePerspective View VolumeClipping PlanesWhere is the Image Plane?Field of ViewPerspective ParametersFocal Distance to FOVOpenGLgluPerspective to glFrustumStereo ViewingStereo FrustumPerspective Projection MatricesMapping LinesSlide 29Complete Perspective ProjectionOpenGL Perspective ProjectionNear/Far and Depth Resolution10/12/04 © University of Wisconsin, CS559 Spring 2004Last Time•Orthographic projection•Viewing transformations–Setting up a camera position and orientation10/12/04 © University of Wisconsin, CS559 Spring 2004Today•Perspective viewing•Homework 3 due10/12/04 © University of Wisconsin, CS559 Spring 2004Review•View Space is a coordinate system with the viewer looking down the –z axis, with x to the right and y up•The World->View transformation takes points in world space and converts them into points in view space•The Projection matrix, or View->Canonical matrix, takes points in view space and converts them into points in Canonical View Space–Canonical View Space is a coordinate system with the viewer looking along –z, x to the right, y up, and everything to be drawn inside the cube [-1,1]x[-1,1]x[-1,1] using parallel projection10/12/04 © University of Wisconsin, CS559 Spring 2004OpenGL Camera•The default OpenGL image plane has u aligned with the x axis, v aligned with y, and n aligned with z–Means the default camera looks along the negative z axis–Makes it easy to do 2D drawing (no need for any view transformation)•glOrtho(…) sets an orthographic view->canonical matrix–Modifies the GL_PROJECTION matrix•gluLookAt(…) sets the world->view matrix–Takes an image center point, a point along the viewing direction and an up vector–Multiplies a world->view matrix onto the current GL_MODELVIEW matrix–You could do this yourself, using glMultMatrix(…) with the matrix from the previous slides10/12/04 © University of Wisconsin, CS559 Spring 2004Typical View Spec. Usage•GLU functions, such as gluLookAt(…), are not part of the core OpenGL library –They can be implemented with other core OpenGL commands–For example, gluLookAt(…) uses glMultMatrix(…) with the matrix from the previous slides–They are not dependent on a particular graphics cardglMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(l, r, b, t, n, f);glMatrixMode(GL_MODELVIEW);glLoadIdentity();gluLookAt(ex,ey,ez,cx,cy,cx,ux,uy,uz);10/12/04 © University of Wisconsin, CS559 Spring 2004Left vs Right Handed View Space•You can define u as right, v as up, and n as toward the viewer: a right handed system uv=w–Advantage: Standard mathematical way of doing things•You can also define u as right, v as up and n as into the scene: a left handed system vu=w–Advantage: Bigger n values mean points are further away•OpenGL is right handed•Many older systems, notably the Renderman standard developed by Pixar, are left handed10/12/04 © University of Wisconsin, CS559 Spring 2004Perspective Projection•Abstract camera model - box with a small hole in it•Pinhole cameras work in practice10/12/04 © University of Wisconsin, CS559 Spring 2004Distant Objects Are Smaller10/12/04 © University of Wisconsin, CS559 Spring 2004Parallel lines meetcommon to draw film planein front of the focal point10/12/04 © University of Wisconsin, CS559 Spring 2004Vanishing points•Each set of parallel lines (=direction) meets at a different point: The vanishing point for this direction–Classic artistic perspective is 3-point perspective•Sets of parallel lines on the same plane lead to collinear vanishing points: the horizon for that plane•Good way to spot faked images10/12/04 © University of Wisconsin, CS559 Spring 2004Basic Perspective Projection•We are going to temporarily ignore canonical view space, and go straight from view to window–Easier to understand and use for Project 2•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 (the eye)•Define a focal distance, d, and put the image plane there (note d is negative)–You can define d to control the size of the image10/12/04 © University of Wisconsin, CS559 Spring 2004Basic 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)10/12/04 © University of Wisconsin, CS559 Spring 2004Basic Case•Similar triangles gives:vvszxdxvvszydyyv-zvP(xv,yv,zv)P(xs,ys)View Planed10/12/04 © University of Wisconsin, CS559 Spring 2004Simple Perspective Transformation•Using homogeneous coordinates we can write:–Our next big advantage to homogeneous coordinatesdzzyxdyxvvvvssvsdPP010001000010000110/12/04 © University of Wisconsin, CS559 Spring 2004Parallel Lines Meet?•Parallel lines are of the form:–Parametric form: x0 is a point on the line, t is a scalar (distance along the line from x0) and d is the direction of the line (unit vector)–Different x0 give different parallel lines•Transform and go from homogeneous to regular:•Limit as t is dxx t0100100010000100001101000100001000010000000dddddddtzztyytzztxxfzyxftzyxfwzyxfzfyzfxdddd10/12/04 © University of Wisconsin, CS559 Spring 2004General Perspective•The basic equations we have seen give a flavor of what happens, but they are insufficient for all applications•They do not get us to a Canonical View Volume•They make assumptions about the viewing conditions•To get to a Canonical Volume, we need a Perspective Volume …10/12/04 © University of Wisconsin, CS559 Spring 2004Perspective 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,


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?