The Camera Analogy ► Set up your tripod and point the camera at the scene (viewing transformation) ► Arrange the scene to be photographed into the desired.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

OpenGL Course Notes Chapter 3: Viewing Jim Mims, Spring 2009.
02/17/05CISC640/440 OpenGL Tutorial1 OpenGL Tutorial CISC 640/440 Computer Graphics TA: Qi Li/Mani Thomas
Graphics Pipeline.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
The View Frustum and the Camera Lecture 19 Fri, Oct 10, 2003.
Based on slides created by Edward Angel
Viewing and Transformation
Viewing and Projections
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Computer Graphics (Fall 2008) COMS 4160, Lecture 4: Transformations 2
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Introduction to OpenGL Pipeline From Programmer View Tong-Yee Lee.
Computer Graphics 3D Transformations. 3D Translation Remembering 2D transformations -> 3x3 matrices, take a wild guess what happens to 3D transformations.
CS 470 Introduction to Computer Graphics Basic 3D in OpenGL.
Introduction to 3D viewing 3D is just like taking a photograph!
2002 by Jim X. Chen: 2D viewing –Window –Viewport 3D viewing –Projection methods and viewing volumes –Normalization –Clipping.
UniS CS297 Graphics with Java and OpenGL Viewing, the model view matrix.
UBI 516 Advanced Computer Graphics Three Dimensional Viewing
Advanced Computer Graphics Three Dimensional Viewing
Computer Graphics, KKU. Lecture 131 Transformation and Viewing in OpenGL.
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
Geometric transformations The Pipeline
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Introduction to OpenGL 1. 2 OpenGL A Graphics rendering API introduced in 1992 by Silicon Graphics Inc Provide the low-level functions to access graphics.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 4: Transformations 2
Stages of Vertex Transformation To specify viewing, modeling, and projection transformations, you construct a 4 × 4 matrix M, which is then multiplied.
Computer Graphics Bing-Yu Chen National Taiwan University.
Computer Graphics I, Fall 2010 Computer Viewing.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
OpenGL Viewing and Modeling Transformation Geb Thomas Adapted from the OpenGL Programming Guidethe OpenGL Programming Guide.
Viewing and Transformation. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
CGGM Lab. Tan-Chi Ho 2001 Viewing and Transformation.
Projections. Viewports Windows can have separate viewports void glViewport(GLint x, GLint y, GLsizei width, GLsizei height ) x, y - Specify the lower.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Introduction to Computer Graphics: Viewing Transformations Rama C
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Chap 3 Viewing and Transformation
Honours Graphics 2008 Session 3. Today’s focus Perspective and orthogonal projection Quaternions Graphics camera.
CS 4731: Computer Graphics Lecture 12: More 3D Viewing Emmanuel Agu.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
GL transformations-models. x' = x+t x y' = y+t y z' = z+t z t x t y s x =s y =s z t z uniform nonuniform?!!?? x' = x·s x y' =
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
Coordinate Systems Lecture 20 Wed, Oct 15, Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally.
OpenGL LAB III.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Computer Graphics Lecture 41 Viewing Using OpenGL Taqdees A. Siddiqi
Introduction to 3-D Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 27, 2003.
CSC Graphics Programming
Viewing.
Computer Viewing.
Courtesy of Drs. Carol O’Sullivan / Yann Morvan Trinity College Dublin
Isaac Gang University of Mary Hardin-Baylor
Projection v VP u VPN n.
VIEWING 2D viewing Window Viewport
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Computer Graphics, KKU. Lecture 13
Three-Dimensional viewing
Projection in 3-D Glenn G. Chappell
Type of View Perspective View COP(Center of Plane) Diminution of size
University of New Mexico
Computer Graphics 3Practical Lesson
Chapter 3 Viewing.
Projection v VP u VPN n.
Presentation transcript:

The Camera Analogy ► Set up your tripod and point the camera at the scene (viewing transformation) ► Arrange the scene to be photographed into the desired composition (modeling transformation) ► Choose a camera lens or adjust the zoom (projection transformation) ► Determine how large you want the final photograph to be (viewport transformation)

Computer Steps ► Viewing (Positioning the viewing volume in the world – moving the position and orientation of the eye) ► Modeling (Positioning the models in the world – translate, scale, rotate) ► Projection (Determine the shape of the view volume) ► Viewport (Deciding how large/small you want the final photograph to be)

Stages of Vertex Transformation ► The viewing and modeling transformations you specify are combined to form the modelview matrix. ► The modelview matrix is applied to the incoming object coordinates to yield eye coordinates ► Next, OpenGL applies the projection matrix to yield clip coordinates. This transformation defines a viewing volume and objects outside this volume are clipped so that they are not drawn in the final scene.

Stages of Vertex Transformation ► If a perspective projection is being performed, a perspective division is done by dividing coordinates by w to produce normalized device coordinates. ► Finally, the transformed coordinates are converted to window coordinates by applying the viewport transformation. You can manipulate the dimensions of the viewport to cause the final image to be enlarged, shrunk, or stretched.

Stages of Vertex Transformation

The Viewing Transformation ► Positioning the view volume in the world ► Achieved in OpenGL by glMatrixMode (GL_MODELVIEW); glMatrixMode (GL_MODELVIEW); glLoadIdentity() glLoadIdentity() gluLookAt (eyex, eyey, eyez, gluLookAt (eyex, eyey, eyez, centerx, centery, centerz, centerx, centery, centerz, upx, upy, upz); upx, upy, upz);

Viewing: gluLookAT ► Takes 9 GLdouble arguments  (eyex, eyey, eyez) is the position of the eye or the viewpoint.  (centerx, centery, centerz) specifies some point along the desired line of site, but typically specifies some point in the center of the scene being looked at.  (upx, upy, upz) arguments indicate which direction is up (that is the direction from the bottom to the top of the viewing volume).

Modeling ► glTranslate*() to move objects in the world ► glScale*() to resize objects in the world ► glRotate*() to rotate objects in the world ► Actually gluLookAt() encapsulates several OpenGL commands – specifically glTranslate*() and glRotate*().

Projection ► Specify the view volume ► We will start with an orthographic projection ► The view volume will be a rectangular parallelpiped, or more informally, a box. ► Distance from the camera will not affect how large an object appears. ► Used in applications where it is crucial to maintain actual sizes of objects & angles

Orthographic Projection

glOrtho() ► Creates an orthographic parallel viewing volume. glOrtho (left, right, bottom, top, near, far); top, near, far); (left, bottom, -near) and (right, top, -near) are points on the near clipping plane. (left, bottom, -far) and (right, top, -far) are points on the far clipping plane.

Viewport Transformation