Unformatted text preview:

Last Time Toolkits Transformations Rotation is complex in 3D Any rotation can be expressed with an axis and angle approach Points on the axis do not move anywhere points off the axis rotate around it The axis passes through the origin 02 21 02 c 2001 University of Wisconsin CS559 Today Viewing Orthographic viewing Homework 3 02 21 02 c 2001 University of Wisconsin CS559 Modeling 101 For the moment assume that all geometry consists of points lines and faces Line A segment between two endpoints Face A planar area bounded by line segments Any face can be triangulated broken into triangles 02 21 02 c 2001 University of Wisconsin CS559 Modeling and OpenGL In OpenGL all geometry is specified by stating which type of object and then giving the vertices that define it glBegin glEnd glVertex 34 fdv Three or four components regular or homogeneous Float double or vector eg float 3 Chapter 2 of the red book 02 21 02 c 2001 University of Wisconsin CS559 Rendering Generate an image showing the contents of some region of space The region is called the view volume and it is defined by the user Determine where each object should go in the image Viewing Projection Determine which object is in front at each pixel Hidden surface elimination Hidden surface removal Visibility Determine what color it is Lighting Shading 02 21 02 c 2001 University of Wisconsin CS559 Graphics 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 pipeline Local Coordinate Space 02 21 02 World Coordinate Space View Space c 2001 University of Wisconsin CS559 3D Screen Space Display Space Local 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 axis 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 objects and such libraries do exist 02 21 02 c 2001 University of Wisconsin CS559 Global Coordinate System Everything in the world is transformed into one coordinate system the global coordinate system Actually some things like dashboards may be defined in a different space but we ll ignore that 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 here 02 21 02 c 2001 University of Wisconsin CS559 View Space Associate a set of axes with the image plane The image plane is the plane in space on which the image should appear like the film plane of a camera One normal to the image plane One up in the image plane One right in the image plane These three axes define a coordinate system a rigid body transform of the world system Some camera parameters are easiest to define in this space Focal length image size Depth is represented by a single number in this space The normal to image plane coordinate 02 21 02 c 2001 University of Wisconsin CS559 3D Screen Space Transform view space into a cube 1 1 1 1 1 1 The cube is the canonical view volume Parallel sides make many operations easier Tasks to do 02 21 02 Clipping decide what you can see Rasterization decide which pixels are covered Hidden surface removal decide what is in front Shading decide what color things are c 2001 University of Wisconsin CS559 Window Space Also called screen space confusing Convert the virtual screen into real screen coordinates Drop the depth coordinates and translate The windowing system takes care of this 02 21 02 c 2001 University of Wisconsin CS559 3D Screen to Window Transform Typically windows are specified by an origin width and height Origin is either bottom left or top left corner expressed as x y on the total visible screen on the monitor or in the framebuffer This representation can be converted to xmin ymin and xmax ymax 3D Screen 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 02 21 02 c 2001 University of Wisconsin CS559 3D Screen to Window Transform 1 1 xmax ymax xmin ymin 1 1 How much do we translate How much do we scale 02 21 02 c 2001 University of Wisconsin CS559 3D Screen to Window Transform 1 1 xmax ymax xmin ymin 1 1 x pixel xmax y pixel z pixel 1 02 21 02 xmin 2 0 0 0 ymax 0 0 ymin 2 0 0 1 0 0 xmax xmin ymax ymin c 2001 University of Wisconsin CS559 0 1 2 xscreen 2 yscreen z screen 1 Orthographic Projection Orthographic projection projects all the points in the world along parallel lines onto the image plane Projection lines are perpendicular to the image plane Like a camera with infinite focal length The result is that parallel lines in the world project to parallel lines in the image and ratios of lengths are preserved This is important in some applications like medical imaging and some computer aided design tasks 02 21 02 c 2001 University of Wisconsin CS559 Simple Orthographic Projection Specify the region of space that we wish to render as a view volume Assume that the viewer is looking in the z direction with x to the right and y up Assuming a right handed coordinate system The view volume has 02 21 02 a near plane at z n y a far plane at z f f n a left plane at x l z x a right plane at x r x r r l a top plane at y t and a bottom plane at y b y b b t l t f r b n c 2001 University of Wisconsin CS559 Rendering the Volume To project map the view volume onto the canonical view volume After that we know how to map the view volume to the window The mapping looks just like the one for screen window xscreen 2 y screen z screen 1 r l 0 0 0 0 0 r l r l xview 2 t b 0 t b t b yview 0 2 n f n f n f zview 0 0 1 1 x screen M view screen x view 02 21 02 c 2001 University of Wisconsin CS559 General Orthographic Projection We could look at the world from any direction not just along z The image could rotated in any way about the viewing direction x need not be right and y need not be up How can we specify the view under these circumstances 02 21 02 c 2001 University of Wisconsin CS559 Specifying a View The location of the image plane in …


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
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 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?