CS 428: Fall Introduction to. Viewing and projective transformations. Andrew Nealen, Rutgers, /23/2009 1

Similar documents
Lecture 4: Viewing. Topics:

CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection. Emmanuel Agu

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

Viewing in 3D (Chapt. 6 in FVD, Chapt. 12 in Hearn & Baker)

Overview of Projections: From a 3D world to a 2D screen.

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

OpenGL Transformations

Geometry: Outline. Projections. Orthographic Perspective

Name: [20 points] Consider the following OpenGL commands:

Evening s Goals. Mathematical Transformations. Discuss the mathematical transformations that are utilized for computer graphics

CS 543: Computer Graphics. Projection

CPSC 314, Midterm Exam. 8 March 2013

Realtime 3D Computer Graphics & Virtual Reality. Viewing

Viewing and Projection

CPSC 314, Midterm Exam 1. 9 Feb 2007

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Viewing/Projection IV. Week 4, Fri Jan 29

Computer Graphics. Chapter 10 Three-Dimensional Viewing

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

Projection: Mapping 3-D to 2-D. Orthographic Projection. The Canonical Camera Configuration. Perspective Projection

Viewing/Projections III. Week 4, Wed Jan 31

The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes

CPSC 314, Midterm Exam. 8 March 2010

Viewing and Projection

Prof. Feng Liu. Fall /19/2016

Getting Started. Overview (1): Getting Started (1): Getting Started (2): Getting Started (3): COSC 4431/5331 Computer Graphics.

CS 475 / CS 675 Computer Graphics. Lecture 7 : The Modeling-Viewing Pipeline

CS 4204 Computer Graphics

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011

5.8.3 Oblique Projections

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CS Computer Graphics: Transformations & The Synthetic Camera

3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy

Chap 7, 2009 Spring Yeong Gil Shin

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Viewing Transformation

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Using GLU/GLUT Objects. GLU/GLUT Objects. glucylinder() glutwirecone() GLU/GLUT provides very simple object primitives

Three-Dimensional Viewing Hearn & Baker Chapter 7

7. 3D Viewing. Projection: why is projection necessary? CS Dept, Univ of Kentucky

Lecture 4. Viewing, Projection and Viewport Transformations

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

1/29/13. Computer Graphics. Transformations. Simple Transformations

6. Modelview Transformations

COMP Computer Graphics and Image Processing. a6: Projections. In part 2 of our study of Viewing, we ll look at. COMP27112 Toby Howard

Transforms 3: Projection Christian Miller CS Fall 2011

Viewing. Part II (The Synthetic Camera) CS123 INTRODUCTION TO COMPUTER GRAPHICS. Andries van Dam 10/10/2017 1/31

Viewing COMPSCI 464. Image Credits: Encarta and

Chap 7, 2008 Spring Yeong Gil Shin

CITSTUDENTS.IN VIEWING. Computer Graphics and Visualization. Classical and computer viewing. Viewing with a computer. Positioning of the camera

Transformation Pipeline

3-Dimensional Viewing

Viewing and Projection

CS380: Computer Graphics Viewing Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

p =(x,y,d) y (0,0) d z Projection plane, z=d

3.1 Viewing and Projection

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

CSE 167: Introduction to Computer Graphics Lecture #5: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

3D Viewing and Projec5on. Taking Pictures with a Real Camera. Steps: Graphics does the same thing for rendering an image for 3D geometric objects

Models and The Viewing Pipeline. Jian Huang CS456

Overview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization

Computer Viewing Computer Graphics I, Fall 2008

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010)

1 (Practice 1) Introduction to OpenGL

3D Viewing. With acknowledge to: Ed Angel. Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

Viewing and Projection

2D and 3D Viewing Basics

Viewing and Modeling

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Transformations III. Week 2, Fri Jan 19

3D Viewing. CS 4620 Lecture 8

COMP3421. Introduction to 3D Graphics

Announcements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

Fundamental Types of Viewing

Modeling Transformations

COMP3421. Introduction to 3D Graphics

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

Computer Graphics. P05 Viewing in 3D. Part 1. Aleksandra Pizurica Ghent University

Announcements. Tutorial this week Life of the polygon A1 theory questions

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Overview. By end of the week:

COMP3421. Introduction to 3D Graphics

The View Frustum. Lecture 9 Sections 2.6, 5.1, 5.2. Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2011

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library.

One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface

Rasterization Overview

What does OpenGL do?

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Transformations. Examples of transformations: shear. scaling

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

Classical and Computer Viewing. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Transcription:

CS 428: Fall 29 Introduction to Computer Graphics Viewing and projective transformations Andrew Nealen, Rutgers, 29 9/23/29

Modeling and viewing transformations Canonical viewing volume Viewport transformation Window coordinates Andrew Nealen, Rutgers, 29 9/23/29 2

Modeling and viewing OpenGL order glmatrimode(gl_modelview) glloadidentit() glmultmatri(v) glmultmatri(m) draw() transformations Transformation is VM In OpenGL, these transformations are place on the modelview matri stack The projectionmatri stack is onl for storing the projection matri resulting from glortho(), glfrustum(), or gluprojection() Andrew Nealen, Rutgers, 29 9/23/29 3

3D viewing The ee has a view cone Approimated in CG b a rectangular cone = square frustum Good for rectangular viewing window Andrew Nealen, Rutgers, 29 9/23/29 4

3D viewing process Andrew Nealen, Rutgers, 29 9/23/29 5

Truncated view volumes Orthographic Andrew Nealen, Rutgers, 29 9/23/29 6

Truncated view volumes Perspective Andrew Nealen, Rutgers, 29 9/23/29 7

Where s the film? A rectangle with known aspect ratio on the infinite film plane Where doesn t matter, as long as the film plane is parallel to farand near Will be scaled to viewport coordinates Andrew Nealen, Rutgers, 29 9/23/29 8

OpenGL projection matrices How is this implemented in OpenGL? The following matrices assume Camera center at origin Looking down negative z-ais -ais is up near, far> right= -left= top= -bottom= See glortho()etc. manpages for general case Andrew Nealen, Rutgers, 29 9/23/29 9

OpenGL projection matrices Orthographic projection Andrew Nealen, Rutgers, 29 9/23/29

OpenGL projection matrices Perspective projection Andrew Nealen, Rutgers, 29 9/23/29

Perspective projections Perspective projections are not affine transformations Relative lengths are no longer invariant Distant objects (of same size) are made smaller than near ones (= foreshortening) Given a projected point P=(, ) t and ee position A=(-, ) t, then b the theorem of intersecting lines the image B is (, ) t = + Andrew Nealen, Rutgers, 29 9/23/29 2

Perspective projections In general, the mapping is Resulting in the homogeneous 3 3-Matri + a + = 2D-Geometr! = = ' ' + + = 9/23/29 3 Andrew Nealen, Rutgers, 29

Perspective projections The projection is composed of two transformations The perspective transformation The subsequent parallel projection The subsequent parallel projection Perspective projection Parallelprojection Perspective transformation = 9/23/29 4 Andrew Nealen, Rutgers, 29

Perspective transformations Properties of perspective transformations of the form + = = w w w T p 9/23/29 5 Andrew Nealen, Rutgers, 29

Field of view and viewing line All points on the affine Line = - are mapped to infinite points Onl points on one side of this line are transformed These points are in the field of view, and the line = - is the viewing line Ee point Field of view Main vanishing point Viewing line Projection line Vanishing line Andrew Nealen, Rutgers, 29 9/23/29 6

Fied points and lines Points on the projection line = (= -ais) together with the infinite point [,, ] are fied points of this transformation (the -ais is invariant) Lines parallel to the -ais remain parallel Field of view Ee point Main vanishing point Viewing line Andrew Nealen, Rutgers, 29 Projection line Vanishing line Projection line Vanishing line 9/23/29 7

Fied points and lines Points on the projection line = (= -ais) together with the infinite point [,, ] are fied points of this transformation (the -ais is invariant) Lines parallel to the -ais remain parallel Lines are transformed to lines 9/23/29 8 Andrew Nealen, Rutgers, 29 = + + = + = + = = factor image obj obj obj obj obj obj obj obj obj p a T

Parallel lines The affine (ee) point [-,, ] t is transformed to the infinite point [-,, ] t =[-,, ] t The points on the affine -ais are invariant Field of view Ee point Main vanishing point Viewing line Andrew Nealen, Rutgers, 29 Projection line Vanishing line Projection line Vanishing line 9/23/29 9

Parallel lines Lines are mapped to lines A line through ee point [-,, ] t, which intersects the - ais at [,, ] t is mapped to a line parallel to the -ais passing through [,, ] t Field of view Ee point Main vanishing point Viewing line Andrew Nealen, Rutgers, 29 Projection line Vanishing line Projection line Vanishing line 9/23/29 2

Vanishing line The point [,, ] t is mapped to [, /, ] t Note that [,, ] t is a directionand [, /, ] t is a point The mappings of all lines parallel to the affine line with direction [,, ] t contain the point [, /,] t, meaning the all intersect in this point The union of the mappings of all lines with direction [,, ] t lie on the line = (= vanishing line) Andrew Nealen, Rutgers, 29 9/23/29 2

Vanishing line The point [,, ] t is mapped to [, /, ] t Note that [,, ] t is a directionand [, /, ] t is a point Field of view Ee point Main vanishing point Viewing line Projection line Vanishing line Projection line Vanishing line Andrew Nealen, Rutgers, 29 9/23/29 22

Vanishing point The point [,, ] t is mapped to [, /, ] t Note that [,, ] t is a directionand [, /, ] t is a point All lines with direction [,, ] t are mapped to [,, ] t Field of view Ee point Main vanishing point Viewing line Projection line Vanishing line Projection line Vanishing line Andrew Nealen, Rutgers, 29 9/23/29 23

One, two and three vanishing point perspectives General perspective transformation + + + = = w z w z w z T p The directions of lines parallel to the coordinate aes are mapped to the vanishing points[,,, ] t, [,,, ] t, [,, z, ] t z w z w 9/23/29 24 Andrew Nealen, Rutgers, 29

In OpenGL code For eample, in reshape(...) glviewport(,, width, height) glmatrimode(gl_projection) glloadidentit() gluperspective(...) glmatrimode(gl_modelview) In render() glulookat(...) gltranslatef(...) glrotatef(...) draw_scene() Perspective transformation Viewing transformation Modeling transformations Andrew Nealen, Rutgers, 29 9/23/29 25

Geometric construction

Geometric construction This transformation maps points [,,] to [,,/4] The vanishing point of parallel lines AB and DC can be computed from the direction [4,,] as [4,,], which is the 2D point [4,]

Geometric construction Fied points

Geometric construction Points before parallel projection Points after parallel projection Fied points A

Geometric construction Points before parallel projection Points after parallel projection Fied points A B

Geometric construction Points before parallel projection Points after parallel projection Fied points A B D C Lines parallel to the projection line remain parallel

Geometric construction Points before parallel projection Points after parallel projection Fied points A B D C Lines parallel to the projection line remain parallel

Geometric construction A Ee point (-4,, ) = at infinit B D C