DOC PREVIEW
UW-Madison CS 559 - CS 559 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:

Last TimeTodayGraphics PipelineLocal Coordinate SpaceWorld Coordinate SystemView SpaceCanonical View VolumeWindow SpaceCanonical  Window TransformSlide 10Slide 11Slide 12Slide 13View VolumesOrthographic ProjectionOrthographic View SpaceRendering the VolumeOrthographic Projection Matrix (Orthographic View to Canonical Matrix)Defining CamerasSpecifying a ViewGeneral OrthographicGetting there…View Space in World SpaceSlide 24World to ViewAll TogetherOpenGL and TransformationsOpenGL CameraTypical UsageLeft vs Right Handed View Space10/7/04 © University of Wisconsin, CS559 Fall 2004Last Time•Transformations•Homogeneous coordinates•Directions•Rotation•Geometry 101 – Points, edges, triangles/polygons•Homework 3 due Oct 12 in class10/7/04 © University of Wisconsin, CS559 Fall 2004Today•Viewing Transformations•Describing Cameras and Views10/7/04 © University of Wisconsin, CS559 Fall 2004Graphics Pipeline•Graphics hardware employs a sequence of coordinate systems–The location of the geometry is expressed in each coordinate system in turn, and modified along the way–The movement of geometry through these spaces is considered a pipelineLocal Coordinate SpaceWorld Coordinate SpaceView SpaceCanonical View VolumeDisplay Space10/7/04 © University of Wisconsin, CS559 Fall 2004Local Coordinate Space•It is easiest to define individual objects in a local coordinate system–For instance, a cube is easiest to define with faces parallel to the coordinate axes•Key idea: Object instantiation–Define an object in a local coordinate system–Use it multiple times by copying it and transforming it into the global system–This is the only effective way to have libraries of 3D objects10/7/04 © University of Wisconsin, CS559 Fall 2004World Coordinate System•Everything in the world is transformed into one coordinate system - the world coordinate system–It has an origin, and three coordinate directions, x, y, and z•Lighting is defined in this space–The locations, brightness’ and types of lights•The camera is defined with respect to this space•Some higher level operations, such as advanced visibility computations, can be done here10/7/04 © University of Wisconsin, CS559 Fall 2004View Space•Define a coordinate system based on the eye and image plane – the camera–The eye is the center of projection, like the aperture in a camera–The image plane is the orientation of the plane on which the image should “appear,” like the film plane of a camera•Some camera parameters are easiest to define in this space–Focal length, image size•Relative depth is captured by a single number in this space–The “normal to image plane” coordinate10/7/04 © University of Wisconsin, CS559 Fall 2004Canonical View Volume•Canonical View Space: A cube, with the origin at the center, the viewer looking down –z, x to the right, and y up–Canonical View Volume is the cube: [-1,1]×[-1,1]×[-1,1]–Variants (later) with viewer looking down +z and z from 0-1–Only things that end up inside the canonical volume can appear in the window•Tasks: Parallel sides and unit dimensions make many operations easier–Clipping – decide what is in the window–Rasterization - decide which pixels are covered–Hidden surface removal - decide what is in front–Shading - decide what color things are10/7/04 © University of Wisconsin, CS559 Fall 2004Window Space•Window Space: Origin in one corner of the “window” on the screen, x and y match screen x and y•Windows appear somewhere on the screen–Typically you want the thing you are drawing to appear in your window–But you may have no control over where the window appears•You want to be able to work in a standard coordinate system – your code should not depend on where the window is•You target Window Space, and the windowing system takes care of putting it on the screen10/7/04 © University of Wisconsin, CS559 Fall 2004Canonical  Window Transform•Problem: Transform the Canonical View Volume into Window Space (real screen coordinates)–Drop the depth coordinate and translate–The graphics hardware and windowing system typically take care of this – but we’ll do the math to get you warmed up•The windowing system adds one final transformation to get your window on the screen in the right place10/7/04 © University of Wisconsin, CS559 Fall 2004Canonical  Window Transform•Typically, windows are specified by a corner, width and height–Corner expressed in terms of screen location–This representation can be converted to (xmin,ymin) and (xmax,ymax)•We want to map points in Canonical View Space into the window–Canonical View Space goes from (-1,-1,-1) to (1,1,1)–Lets say we want to leave z unchanged•What basic transformations will be involved in the total transformation from 3D screen to window coordinates?10/7/04 © University of Wisconsin, CS559 Fall 2004Canonical  Window Transform(-1,-1)(1,1)(xmin,ymin)(xmax,ymax)10/7/04 © University of Wisconsin, CS559 Fall 2004Canonical  Window Transform(-1,-1)(1,1)(xmin,ymin)(xmax,ymax)      110000100202020021minmaxminmaxminmaxminmaxcanonicalcanonicalcanonicalpixelpixelpixelzyxyyyyxxxxzyx10/7/04 © University of Wisconsin, CS559 Fall 2004Canonical  Window Transform•You almost never have to worry about the canonical to window transform•In OpenGL, you tell it which part of your window to draw in – relative to the window’s coordinates–That is, you tell it where to put the canonical view volume–You must do this whenever the window changes size–Window (not the screen) has origin at bottom left–glViewport(minx, miny, maxx, maxy)–Typically: glViewport(0, 0, width, height)fills the entire window with the image–Why might you not fill the entire window?•The textbook derives a different transform, but the same idea10/7/04 © University of Wisconsin, CS559 Fall 2004View Volumes•Only stuff inside the Canonical View Volume gets drawn–The window is of finite size, and we can only store a finite number of pixels–We can only store a discrete, finite range of depths•Like color, only have a fixed number of bits at each pixel–Points too close or too far away will not be drawn–But, it is inconvenient to model the world as a unit box•A view volume is the region of space we wish to


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?