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

Similar documents
Overview. By end of the week:

CSC 305 The Graphics Pipeline-1

3D Viewing. CS 4620 Lecture 8

Models and The Viewing Pipeline. Jian Huang CS456

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9

Drawing in 3D (viewing, projection, and the rest of the pipeline)

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

CSE328 Fundamentals of Computer Graphics

Lecture 4. Viewing, Projection and Viewport Transformations

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

3D Viewing Episode 2

Viewing. Announcements. A Note About Transformations. Orthographic and Perspective Projection Implementation Vanishing Points

Viewing. Reading: Angel Ch.5

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

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

Pipeline Operations. CS 4620 Lecture 14

COMP3421. Introduction to 3D Graphics

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Three-Dimensional Viewing Hearn & Baker Chapter 7

The Graphics Pipeline and OpenGL I: Transformations!

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Computer Graphics 7: Viewing in 3-D

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

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

Game Architecture. 2/19/16: Rasterization

Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.1~4.7

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

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

Rasterization Overview

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

Projection and viewing. Computer Graphics CSE 167 Lecture 4

Computer Graphics. Lecture 04 3D Projection and Visualization. Edirlei Soares de Lima.

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

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

Virtual Cameras and The Transformation Pipeline

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

2D and 3D Viewing Basics

Computer Graphics. Coordinate Systems and Change of Frames. Based on slides by Dianna Xu, Bryn Mawr College

GEOMETRIC TRANSFORMATIONS AND VIEWING

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Lecture 5 2D Transformation

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

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Graphics Pipeline 2D Geometric Transformations

Advanced Computer Graphics Transformations. Matthias Teschner

COMP3421. Introduction to 3D Graphics

Geometric Transformations

Geometry: Outline. Projections. Orthographic Perspective

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

CT5510: Computer Graphics. Transformation BOCHANG MOON

The Graphics Pipeline and OpenGL I: Transformations!

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

The Importance of Matrices in the DirectX API. by adding support in the programming language for frequently used calculations.

Viewing and Projection

Transforms 3: Projection Christian Miller CS Fall 2011

For each question, indicate whether the statement is true or false by circling T or F, respectively.

CS4620/5620: Lecture 14 Pipeline

CSE452 Computer Graphics

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

OpenGL Transformations

Viewing with Computers (OpenGL)

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

Specifying Complex Scenes

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

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

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

Viewing COMPSCI 464. Image Credits: Encarta and

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

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

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Viewing and Projection

3D Graphics for Game Programming (J. Han) Chapter II Vertex Processing

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

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

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

Viewing and Projection

Transformation Pipeline

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

Graphics 2009/2010, period 1. Lecture 6: perspective projection

Last week. Machiraju/Zhang/Möller/Fuhrmann

CS 4204 Computer Graphics

Fachhochschule Regensburg, Germany, February 15, 2017

Vector Algebra Transformations. Lecture 4

Graphics Pipeline. CS535 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Rigid Body Motion and Image Formation. Jana Kosecka, CS 482

CS451Real-time Rendering Pipeline

CS452/552; EE465/505. Geometry Transformations

CSE 167: Introduction to Computer Graphics Lecture #3: Coordinate Systems

COMP3421. Vector geometry, Clipping

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

On the Midterm Exam. Monday, 10/17 in class. Closed book and closed notes. One-side and one page cheat sheet is allowed. A calculator is allowed

Transformations. Examples of transformations: shear. scaling

Viewing and Projection Transformations

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

CS488. Implementation of projections. Luc RENAMBOT

Transcription:

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

Rendering approaches 1. image-oriented foreach pixel... 2. object-oriented foreach object... geometry 3D rendering pipeline image object-oriented rendering - e.g., OpenGL graphics pipeline, Renderman (REYES) task: figure out where a point in the geometry will land on the final image pixels

Projection: map 3D scene to 2D image OpenGL Super Bible, 5th Ed.

Orthographic projection vector.tutsplus.com Orthographic, or parallel projection - parallel lines appear parallel (unlike perspective proj.) - equal length lines appear equal length (unlike perspective proj.)

Perspective projection www.artyfactory.com

two-point perspective three-point perspective

Viewing Transformations

Viewing ations World space Viewing ations Screen space Map points from their 3D locations to their positions in a 2D view World coordinates Screen coordinates The viewing ation also project any point along pixel s viewing ray back to the pixel s position in screen (or image) space

Decomposition of viewing s Camera Projection Viewport rigid body ation place camera at origin x, y, z in [-1,1] depends on type of projection map to pixel coordinates Viewing s depend on: camera position and orientation, type of projection, field of view, image resolution there are several names for these spaces: camera space = eye space, canonical view volume = clip space = normalized device coordinates, screen space=pixel coordinates and for the s: camera ation = viewing ation

Viewport Camera Projection Viewport

Viewport Camera Projection Viewport <whiteboard>

Orthographic Projection Transform Camera Projection Viewport <whiteboard>

Camera Transform Camera Projection Viewport

Camera Transform How do we specify the camera configuration? (orthogonal case)

Camera Transform How do we specify the camera configuration? eye position

Camera Transform gaze How do we specify the camera configuration? direction

Camera Transform How do we specify the camera configuration? up vector

Camera Transform How do we specify the camera configuration?

Camera Transform Camera Projection Viewport <whiteboard>

Perspective Viewing

parallel lines, angles preserved parallel lines preserved rigid - translation and rotation only - parallel lines and angles are preserved affine - scaling, shear, translation, rotation - parallel lines preserved, angles not preserved projective - parallel lines and angles not preserved

Projective Transformations view plane note that the height, y, in camera space is proportion to y and inversely proportion to z. We note that the height, y, in camera space is proportional to y and inversely proportion to z. We want to be able to specify such a ation with our 4x4 matrix machinery

Projective Transformations How to represent this with 4x4 matrices? view plane note that the height, y, in camera space is proportional to y and inversely proportion to z. We want to be able to specify such a ation with our 4x4 matrix machinery note that the height, y, in camera space is proportion to y and inversely proportion to z. We

Projective Transformations Example: Use 4th coordinate as the denominator [Shirley, Marschner] Note: this this makes makes our homogeneous our homogeneous representation representation for unique only up for to points a constant unique only up to a constant

Projective Transformations Example: We can now implement perspective projection! [Shirley, Marschner]

Perspective Projection view plane both x and y get multiplied by d/z [Shirley, Marschner] note that that both both x and x y and will be y ed will be ed

Simple perspective projection This achieves a simple perspective projection onto the view plane z = d but we ve lost all information about z! <whiteboard> This simple projection matrix won t won t suffice. suffice. We We need need to preserve to preserve z information z information later for later hidden surface removal. whiteboard: derive P

Perspective Projection Example: The perspective ation does not preserve z completely, but it preserves z = n, f and The perspective ation does not preserve z completely, but it preserves z = n, f and is monotone (preserves ordering) with respect to z

So far we ve mapped the view frustrum to a rectangular box. This rectangular box has the So far we ve mapped the view frustum to a rectangular box. This rectangular box has the same near face as the view frustum. The far face has been mapped down to the far face of the box. This mapping is given by P. The bottom figure shows how lines in the view frustum get mapped to the rect. box. [Shirley, Marschner]

We re not quite done yet thought, because the projection should map the view We re not quite done yet thought, because the projection should map the view frustum to the canonical view volume.

We need a second mapping to get our points into the canonical view volume. This second We need a second mapping to get our points into the canonical view volume. This second mapping is a mapping from one box to another. So it s given by an orthographic mapping, M_orth. The final perspective ation is the composition of P and M_orth.