Chapter 3 Viewing.

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
1 View Shandong University Software College Instructor: Zhou Yuanfeng
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,
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Modeling and Viewing Modeling
Noggin (BYU Students, SIGGRAPH 2006). Introduction to OpenGL Programming Rick Skarbez, Instructor COMP 575 September 11, 2007.
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.
3D coordinate systems X Y Z Right-Hand Coordinate System X Y Z Left-Hand Coordinate System OpenGL uses this! Direct3D uses this!
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
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.
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.
Graphics Graphics Korea University kucg.korea.ac.kr Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Viewing and Transformation. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture.
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.
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.
Viewing Korea Univ. Computer Graphics Lab. Hong, Jin Kyung.
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Chap 3 Viewing and Transformation
CS559: Computer Graphics Lecture 12: OpenGL - Transformation Li Zhang Spring 2008.
CS559: Computer Graphics Lecture 12: OpenGL: ModelView Li Zhang Spring 2010.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
1 Dr. Scott Schaefer 3D Transformations. 2/149 Review – Vector Operations Dot Product.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Implement of transformation,projection, viewing Hanyang University Jungsik Park.
OpenGL LAB III.
CS380 LAB II OpenGL Donghyuk Kim Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
Computer Graphics Lecture 41 Viewing Using OpenGL Taqdees A. Siddiqi
CSC Graphics Programming
Viewing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Viewing.
Computer Graphics - Chapter 5 Viewing
Computer Viewing.
Courtesy of Drs. Carol O’Sullivan / Yann Morvan Trinity College Dublin
Camera Position (5.6) we specify the position and orientation of the camera to determine what will be seen. use gluLookAt (eye x, y, z, at x, y, z, up.
Isaac Gang University of Mary Hardin-Baylor
Reference1. [OpenGL course slides by Rasmus Stenholt]
Projection v VP u VPN n.
VIEWING 2D viewing Window Viewport
Advanced Graphics Algorithms Ying Zhu Georgia State University
Lecture 08 and 09 View & Projection
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Computer Graphics, KKU. Lecture 13
Three-Dimensional viewing
Computer Graphics (Spring 2003)
Class 12 Complex object with moving parts
Type of View Perspective View COP(Center of Plane) Diminution of size
University of New Mexico
Computer Graphics 3Practical Lesson
THREE-DIMENSIONAL VIEWING II
Projection v VP u VPN n.
Presentation transcript:

Chapter 3 Viewing

Contents Overview: The Camera Analogy Viewing and Modeling Transformation Projection Transformation Viewport Transformation

Chapter Objectives View a geometric model in any orientation Control the location in 3D space Clip Undesired portions of the model

Overview -The Camera Analogy-

Overview: The Camera Analogy Viewing Transformation Positioning the view volume in the world Modeling Transformation Positioning models in the world Projection Transformation Determining the shape of the view volume Viewport Transformation

Method for Transformation - 1 The Viewing Transformation glTranslatef(); glRotatef(); gluLookAt(); The Modeling Transformation glScalef();

Method for Transformation - 2 The Projection Transformation Perspective Orthographic Order of Setting glMatrixMode(types) glLoadIdentity() glFrustum() or gluPerspective(), glOrtho()

General-Purpose Transformation Commands glMatrixMode(GLenum mode) Specifies which matrix will be modified GL_MODELVIEW, GL_PROJECTION, GL_TEXTURE glLoadIdentity() Sets the currently modifiable matrix to the 4*4 identity matrix

General-Purpose Transformation Commands glMultMatrix{fd}(const Type *m) Multiply the current matrix by the matrix passed in as an argument glLoadMatrix{fd}(const Type *m) Set the 16 values of the current matrix to those specified by m

Viewing and Modeling Transformations

Thinking about Transformation To performing viewing or modeling transformation glMatrixMode(GL_MODELVIEW);

2 Types of Coordinate System Example glMatrixMode(GL_MODELVIEW); glloadIdentity(); glMultiMatrixf(N); glMultiMatrixf(M); glBegin(GL_POINTS); glVertex3f(v); glEnd(); Grand, Fixed Coordinate System Moving a Local Coordinate System

Modeling Transformation Translate Void glTranslate{fd}(x, y, z); Rotate Void glRotate{fd}(angle, x, y, z); Scale Void glScale{fd}(x, y, z); glScalef(2.0, -1.5, 1.0);

Viewing Transformation - 1 glTranslate() or glRotate() Moving forward camera = Moving Backward Object gluLookAt() Void gluLookAt( eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz);

Viewing Transformation - 2 Creating a Custom Utility Routine Void PilotView(GLdouble planex, Gldouble planey, Gldouble planez, Gldouble roll, Gldouble pitch, Gldouble heading) { glRotated(roll, 0.0, 0.0, 1.0); glRotated(pitch, 0.0, 1.0, 0.0); glRotated(heading, 1.0, 0.0, 0.0); glTranslated(-planex, -planey, -planez); }

Projection Transformations

Projection Transformations Purpose To define a viewing volume How an object is projected onto the screen How to Clip the object Setting for projection transformation glMatrixMode(GL_PROJECTION); glLoadIdentity();

Perspective Projection - 1 Foreshortening The farther, the smaller object appears in the final image glFrustum(left, right, bottm, top, near, far)

Perspective Projection - 2 gluPerspective(fov, aspect, near, far)

Orthographic Projection -1 View Volume Rectangular parallelepiped

Orthographic Projection -2 glOrtho(left, right, bottom, top, near, far) glOrtho2D (left, right, bottom, top)

Viewport Transformation

Defining the Viewport glViewport(x, y, width, height) gluPerspective(fov, 2.0, near, far); glViewport(0, 0, 400, 200); The Transformed Depth coordinates

Program Demo Transformation\lesson1.exe