Computer Graphics (Spring 2003)

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Lecture 3: Transformations and Viewing. General Idea Object in model coordinates Transform into world coordinates Represent points on object as vectors.
Computer Graphics Lecture 4 Geometry & Transformations.
1 Computer Graphics Chapter 8 3D Transformations.
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
Viewing and Projections
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 5: Viewing
Computer Vision : CISC4/689
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
Transformations and Projections (Some slides adapted from Amitabh Varshney)
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
Introduction to 3D viewing 3D is just like taking a photograph!
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
Geometric transformations The Pipeline
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
CS-378: Game Technology Lecture #2.1: Projection Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Angel: Interactive Computer Graphics CSE 409: Computer Graphics Camera Transformations and Projection Acknowledgements: parts of information and pictures.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
OpenGL Viewing and Modeling Transformation Geb Thomas Adapted from the OpenGL Programming Guidethe OpenGL Programming Guide.
CS 445 / 645 Introduction to Computer Graphics Lecture 10 Camera Models Lecture 10 Camera Models.
2 COEN Computer Graphics I Evening’s Goals n Discuss viewing and modeling transformations n Describe matrix stacks and their uses n Show basic geometric.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
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.
Three-Dimensional Viewing
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 5: Viewing
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Introduction to Computer Graphics: Viewing Transformations Rama C
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Viewing and Projection
CS552: Computer Graphics Lecture 11: Orthographic Projection.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
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.
Outline 3D Viewing Required readings: HB 10-1 to 10-10
3 DIMENSIONAL VIEWING Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Rendering Pipeline Fall, 2015.
University of North Carolina at Greensboro
Computer Viewing.
CSE 167 [Win 17], Lecture 5: Viewing Ravi Ramamoorthi
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.
3D Viewing cgvr.korea.ac.kr.
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
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.
CENG 477 Introduction to Computer Graphics
CSC461: Lecture 19 Computer Viewing
A Photograph of two papers
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Three-Dimensional viewing
Projection in 3-D Glenn G. Chappell
Last Time Canonical view pipeline Projection Local Coordinate Space
Viewing (Projections)
Presentation transcript:

Computer Graphics (Spring 2003) COMS 4160, Lecture 9: Transformations 2 Ravi Ramamoorthi http://www.cs.columbia.edu/~cs4160

Motivation Modeling Objects in convenient coordinate system Transform into world space, eye space Viewing: project world space into 2D rectangle Virtual cameras Types of projections (perspective, orthographic) Window system

Rotations Very brief overview (not in detail) For little more detail, some useful websites: www.cs.berkeley.edu/~ug/slide/pipeline/assignments/as5/rotation.html www.cs.cmu.edu/afs/cs/academic/class/16741-s02/www/lecture6.pdf

Rotations 2D (simple) 3D (complicated) Matrix representation, commutative 3D (complicated) Non-commutative Counterclockwise Matrix reps for axis transforms

Euler Angles Rotate about Z, then new X, then new Z [Goldstein pp 107] Product of axis transforms Efficient, 3 parameters Bad for numerics, splining

Axis-Angle Single axis, angle about it 3 params (axis is normalized) Somewhat intuitive Many of same numerical problems as Euler-Angles Formula (axis-angle to rotation matrix) Dual Matrix of v

Viewing 3D Pipeline (pp 230 FvDFH) Projection 3D -> 2D Clip: near and far planes (viewing volume)

The Whole Viewing Pipeline Eye coordinates Model coordinates Perspective transformation Model transformation Screen coordinates World coordinates Viewport transformation Camera transformation Window coordinates Raster transformation Device coordinates Slide courtesy Greg Humphreys

Projections To lower dimensional space Taxonomy [Fig 6.13, pp 237] Preserve straight lines Trivial example: Drop one coordinate We are concerned with 3D -> 2D Taxonomy [Fig 6.13, pp 237] Perspective [realistic images, no proportions preserved] Parallel [preserves proportions] Orthographic (common in graphics)

Perspective Center of projection, rays, projection plane Distance from center of projection to projection plane is finite. If infinite, projection rays parallel Foreshortening: Key feature Size inverse proportional to distance Cameras, visual system are similar

Perspective or Parallel? If the distance between the center of projection and the projection plane is finite, the projection is called a perspective projection. Otherwise, it’s a parallel projection. A A A’ A’ B B B’ B’ C (at infinity) C Parallel Perspective

Perspective Distortions Lines remain lines, everything else is distorted… Vanishing points for parallel lines Shape distortions Parallel Projections (parallel lines are parallel) Not realistic but preserve size (useful in mechanical drawings)

Parallel (Orthographic) Projection vector (direction of rays) Perpendicular to projection plane : Orthographic Otherwise, oblique. Far off objects in perspective are approx. orthographic Uniform foreshortening Parallelism preserved, angles are not More info in book We now concentrate on perspective…

Perspective mathematically 1 Intuition: divide by z Eye as a point (or pinhole camera) Easy in eye space (homogeneous coordinates) Simple form: equation 6.4 page 255 Full mathematics next week

Overhead View of Our Screen Looks like we’ve got some nice similar triangles here! Next few slides courtesy Greg Humphreys

The Perspective Matrix This “division by z” can be accomplished by a 4x4 matrix We’re in homogeneous coordinates, so if we multiply some point by P, we get . Recall that to get the actual 3D point, you divide by w, giving , which was the point on our screen. Now just drop the third coordinate!

Viewing in OpenGL OpenGL has multiple matrix stacks - transformation functions right-multiply the top of the stack Two most important stacks: GL_MODELVIEW and GL_PROJECTION Points get multiplied by the modelview matrix first, and then the projection matrix This is only really necessary for convenience -- you could ignore all of this and put your entire viewing matrix into one or the other. However, if one is changing and the other one isn’t, you’ll save time

OpenGL Example void SetUpViewing() { // The viewport isn’t a matrix, it’s just state... glViewport( 0, 0, window_width, window_height ); // Set up camera transformation first glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluPerspective( 60, 1, 1, 1000 ); // fov, aspect, near, far gluLookAt( 3, 3, 2, // eye point 0, 0, 0, // look at point 0, 0, 1 ); // up vector // Set up the model transformation glMatrixMode( GL_MODELVIEW ); glRotatef( theta, 0, 0, 1 ); // rotate the model glScalef( zoom, zoom, zoom ); // scale the model }