Chapters 5 2 March 2004. Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

MAT 594CM S2010Fundamentals of Spatial ComputingAngus Forbes Overview Goals of the course: 1. to introduce real-time 3D graphics programming with openGL.
Graphics Pipeline.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Based on slides created by Edward Angel
Viewing and Transformation
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Interactive 3D Graphics and Virtual Reality Introduction to OpenGL concepts Session 2.
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Introduction to OpenGL Pipeline From Programmer View Tong-Yee Lee.
Introduction to OpenGL M. Ramanathan STTP CAD 2011Introduction to OpenGL.
Introduction to 3D viewing 3D is just like taking a photograph!
Introduction to OpenGL Jian Huang This set of slides are extracted from the Interactive OpenGL Programming course given by Dave Shreine, Ed Angel and Vicki.
Further Programming for 3D applications CE Motion, Fundamental Physics and Collision Detection Bob Hobbs Faculty of Computing, Engineering and Technology.
3D coordinate systems X Y Z Right-Hand Coordinate System X Y Z Left-Hand Coordinate System OpenGL uses this! Direct3D uses this!
Viewing and Projections
Computer Graphics (fall 2009)
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
GRAFIKA KOMPUTER ~ M. Ali Fauzi. Drawing 2 D Graphics.
Geometric transformations The Pipeline
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Programming for Virtual Reality Applications Projection in OpenGL Lighting and Shading Lecture 17.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Computer Graphics Bing-Yu Chen National Taiwan University.
Computer Graphics I, Fall 2010 Computer Viewing.
Computing & Information Sciences Kansas State University CIS 536/636 Introduction to Computer Graphics Lecture 4 of 41 William H. Hsu Department of Computing.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
10/7/04© University of Wisconsin, CS559 Fall 2004 Last Time Transformations Homogeneous coordinates Directions Rotation Geometry 101 – Points, edges, triangles/polygons.
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.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
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.
CGGM Lab. Tan-Chi Ho 2001 Viewing and Transformation.
Computing & Information Sciences Kansas State University CG Basics 3 of 8: OpenGL Primer 1 CIS 636/736: (Introduction to) Computer Graphics CIS 636 Introduction.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Introduction to Computer Graphics: Viewing Transformations Rama C
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Chap 3 Viewing and Transformation
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
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
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
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.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
3D Computer Graphics (3080/GV10) Week 5-6 Tutorial 3
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 20 Parallel Projections in OpenGL
Reference1. [OpenGL course slides by Rasmus Stenholt]
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.
Unit 4 3D Viewing Pipeline Part - 2
Advanced Graphics Algorithms Ying Zhu Georgia State University
Fundamentals of Computer Graphics Part 5 Viewing
Lecture 08 and 09 View & Projection
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Interactive Computer Graphics Viewing
Computer Graphics 3Practical Lesson
Presentation transcript:

Chapters 5 2 March 2004

Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane

Classical and Computer Viewing Perspective views –fixed Center of Projection (COP) Parallel Views –COP at infinity

Viewing in OpenGL Perspective Parallel - Orthogonal

Perspective viewing glMatrixMode(GL_PROJECTION); gluPerspective(40.0, 1.0, 1.0, 40.0); // field of view,aspect ratio, z near, z far //0-180w/h + + glMatrixMode(GL_MODELVIEW); gluLookat(0.0, 0.0, 30.0, /* eye */ 0.0, 0.0, 0.0, /* center */ 0.0, 1.0, 0.0); /* up */

Camera Analogy and Transformations Projection transformations –adjust the lens of the camera Viewing transformations –tripod–define position and orientation of the viewing volume in the world Modeling transformations –moving the model Viewport transformations –enlarge or reduce the physical photograph

Coordinate Systems and Transformations Steps in Forming an Image –specify geometry (world coordinates) –specify camera (camera coordinates) –project (window coordinates) –map to viewport (screen coordinates) Each step uses transformations Every transformation is equivalent to a change in coordinate systems (frames)

Affine Transformations Want transformations which preserve geometry –lines, polygons, quadrics Affine = line preserving –Rotation, translation, scaling –Projection –Concatenation (composition)

Specifying Transformations Programmer has two styles of specifying transformations glLoadMatrix, glMultMatrix –specify matrices ( glLoadMatrix, glMultMatrix ) glRotate, glOrtho –specify operation ( glRotate, glOrtho ) Programmer does not have to remember the exact matrices

Programming Transformations Prior to rendering, view, locate, and orient: –eye/camera position –3D geometry Manage the matrices –including matrix stack Combine (composite) transformations

vertexvertex Modelview Matrix Projection Matrix Perspective Division Viewport Transform Modelview Projection object eye clip normalized device window other calculations here –material  color –shade model (flat) –polygon rendering mode –polygon culling –clipping Transformation Pipeline CPU DL Poly. Per Vertex Per Vertex Raster Frag FB Pixel Texture

Applying Projection Transformations Typical use (orthographic projection) glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho( left, right, bottom, top, zNear, zFar ); Typical use (orthographic projection) glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho( left, right, bottom, top, zNear, zFar );

Viewing Transformations Position the camera/eye in the scene –place the tripod down; aim camera To “fly through” a scene –change viewing transformation and redraw scene gluLookAt( eye x, eye y, eye z, aim x, aim y, aim z, up x, up y, up z ) –up vector determines unique orientation –careful of degenerate positions tripod

Projection Tutorial

Transformation Tutorial

Connection: Viewing and Modeling Moving camera is equivalent to moving every object in the world towards a stationary camera Viewing transformations are equivalent to several modeling transformations gluLookAt() has its own command can make your own polar view or pilot view

Projection is left handed Projection transformations ( gluPerspective, glOrtho ) are left handed –think of zNear and zFar as distance from view point Everything else is right handed, including the vertexes to be rendered x x y y z+ left handedright handed

18 resize() : Perspective & Translate Same effect as previous LookAt void resize( int w, int h ) { glViewport( 0, 0, (GLsizei) w, (GLsizei) h ); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluPerspective( 65.0, (GLfloat) w/h, 1.0, ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glTranslatef( 0.0, 0.0, -5.0 ); } Same effect as previous LookAt void resize( int w, int h ) { glViewport( 0, 0, (GLsizei) w, (GLsizei) h ); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluPerspective( 65.0, (GLfloat) w/h, 1.0, ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glTranslatef( 0.0, 0.0, -5.0 ); }

Hidden Surface Removal Modeling a cube –what causes only the 3 front facing sides to be visible? Hidden surface removal algorithms –object space algorithms –image space algorithms »z buffer algorithm (requires DEPTH buffer and the GL_DEPTH_TEST to be enabled)

Hidden Surface Removal Optimize the process by rendering only front facing polygons glEnable(GL_CULL_FACE) –what is a front facing polygon? One with its normal facing the viewer

Homework Begin Presentation. –No class Thursday. Go to the library or online. Browse Computer Graphics articles. Find a topic that interests you. You will need to cite a minimum of two sources for your 10 minute presentation. –Computer Graphics Quarterly - SIGGRAPHComputer Graphics Quarterly –Computer Graphics WorldComputer Graphics World

Program 2 due 3/18 Logic…