DOC PREVIEW
UCSD CSE 167 - Viewing & Perspective

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:

Viewing & PerspectiveCSE167: Computer GraphicsInstructor: Steve RotenbergUCSD, Fall 2005Homogeneous Transformations1 0 00 1110001+++=+++=′+++=′+++=′⋅=′′′⋅=′zyxzzzyzxzzyzyyyxyyxzxyxxxxzyxzzzzyyyyxxxxzyxvvvdvcvbvavdvcvbvavdvcvbvavvvvdcbadcbadcbavvvvMv3D TransformationsSo far, we have studied a variety of useful 3D transformations:RotationsTranslationsScalesShearsReflectionsThese are examples of affine transformationsThese can all be combined into a single 4x4 matrix, with [0 0 0 1] on the bottom rowThis implies 12 constants, or 12 degrees of freedom (DOFs)ABCD VectorsWe mentioned that the translation information is easily extracted directly from the matrix, while the rotation/scale/shear/reflection information is encoded into the upper 3x3 portion of the matrixThe 9 constants in the upper 3x3 matrix make up 3 vectors called a, b, and cIf we think of the matrix as a transformation from object space to world space, then the a vector is essentially the object’s x-axis transformed into world space, b is its y-axis in world space, and c is its z-axis in world spaced is of course the position in world space.Example: YawA spaceship is floating out in space, with a matrix W. The pilot wants to turn the ship 10 degrees to the left (yaw). Show how to modify W to achieve this.Example: YawWe simply rotate W around its own b vector, using the ‘arbitrary axis rotation’ matrix:where Ra(a,θ)=−++−−−−−−++−+−−−−+10000)1()1()1(0)1()1()1(0)1()1()1(222222zzxzyyzxxzyyyzyxyzxzyxxxacasacaasacaasacaaacasacaasacaasacaaacaθθθθθθθθθθθθθθθ( ) ( ) ( )WMWdWTbWRdWTM⋅=′−⋅°⋅= .10,..aSpacesSo far, we’ve discussed the following spacesObject space (local space)World space (global space)Camera spaceCamera SpaceLet’s say we want to render an image of a chair from a certain camera’s point of viewThe chair is placed in world space with matrix WThe camera is placed in world space with matrix CThe following transformation takes vertices from the chair’s object space into world space, and then from world space into camera space:Now that we have the object transformed into a space relative to the camera, we can focus on the next step, which is to project this 3D space into a 2D image spacevWCv ⋅⋅=′−1Image SpaceWhat we really need is a mapping from 3D space into a special “2.5D” image spaceFor practical geometric purposes, it should be thought of as a proper 2D space, but each vertex in this space also has a depth (z coordinate), and so mathematically speaking, it really is a 3D space…We will say that the visible portion of the image ranges from -1 to 1 in both x and y, with 0,0 in the center of the imageThe z coordinate will also range from -1 to 1 and will represent the depth (1 being nearest and -1 being farthest)Image space is sometimes called normalized view space or other things…View ProjectionsSo far we know how to transform objects from object space into world space and into camera spaceWhat we need now is some sort of transformation that takes points in 3D camera space and transforms them into our 2.5D image spaceWe will refer to this class of transformations as view projections (or just projections)Simple orthographic view projections can just be treated as one more affine transformation applied after the transformation into camera spaceMore complex perspective projections require a non-affine transformation followed by an additional division to convert from 4D homogeneous space into image spaceIt is also possible to do more elaborate non-linear projections to achieve fish-eye lens effects, etc., but these require significant changes to the rendering process, not only in the vertex transformation stage, and so we will not cover them…Orthographic ProjectionAn orthographic projection is an affine transformation and so it preserves parallel linesAn example of an orthographic projection might be an architect’s top-down view of a house, or a car designer’s side view of a carThese are very valuable for certain applications, but are not used for generating realistic imagesOrthographic Projection( )−+−−+−−−+−−=⋅⋅⋅=′−1000200020002,,,,,1nearfarnearfarnearfarbottomtopbottomtopbottomtopleftrightleftrightleftrightfarneartopbottomrightleftorthoPvWCPvPerspective ProjectionWith a perspective projection, objects become smaller as they get further from the camera, as one normally gets from a photograph or video imageThe goal of most real-world camera lens makers is to achieve a perfect perspective projectionMost realistic computer generated images use perspective projectionsA fundamental property of perspective projections is that parallel lines will not necessarily remain parallel after the transformation (making them non-affine)View VolumeA camera defines some sort of 3D shape in world space that represents the volume viewable by that cameraFor example, a normal perspective camera with a rectangular image describes a sort of infinite pyramid in spaceThe tip point of the pyramid is at the camera’s origin and the pyramid projects outward in front of the camera into spaceIn computer graphics, we typically prevent this pyramid from being infinite by chopping it off at some distance from the camera. We refer to this as the far clipping planeWe also put a limit on the closest range of the pyramid by chopping off the tip. We refer to this as the near clipping planeA pyramid with the tip cut off is known as a frustum. We refer to a standard perspective view volume as a view frustumView FrustumIn a sense, we can think of this view frustrum as a distorted cube, since it has six faces, each with 4 sidesIf we think of this cube as ranging from -1 to 1 in each dimension xyz, we can think of a perspective projection as a mapping from this view frustrum into a normalized view space, or image spaceWe need a way to represent this transformation mathematicallyView FrustumThe view frustum is usually defined by a field of view (FOV) and an aspect ratio, in addition to the near and far clipping plane distancesDepending on the convention, the FOV may represent


View Full Document

UCSD CSE 167 - Viewing & Perspective

Documents in this Course
Lighting

Lighting

38 pages

Review

Review

59 pages

Surfaces

Surfaces

22 pages

Review

Review

110 pages

Midterm

Midterm

4 pages

Lighting

Lighting

38 pages

Lighting

Lighting

71 pages

Review

Review

110 pages

Lighting

Lighting

71 pages

Load more
Download Viewing & Perspective
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 Viewing & Perspective 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 Viewing & Perspective 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?