Course no. DIS4566 National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor

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

Computer Viewing and Projection. Overview. Computer Viewing. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E.

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

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Virtual Cameras & Their Matrices

Introduction to Computer Graphics 4. Viewing in 3D

Computer Viewing. Prof. George Wolberg Dept. of Computer Science City College of New York

Fundamental Types of Viewing

CS452/552; EE465/505. Intro to Lighting

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

Computer Viewing Computer Graphics I, Fall 2008

Introduction to Computer Graphics with WebGL

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

National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor

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

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

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

CS 418: Interactive Computer Graphics. Projection

Viewing with Computers (OpenGL)

5.8.3 Oblique Projections

Transforms 3: Projection Christian Miller CS Fall 2011

Viewing. Reading: Angel Ch.5

Introduction to Computer Graphics 7. Shading

Computer Graphics Shadow Algorithms

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

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

CS 543: Computer Graphics. Projection

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

3D Viewing. CS 4620 Lecture 8

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

Overview. By end of the week:

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

521493S Computer Graphics Exercise 2 Solution (Chapters 4-5)

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

Computer Graphics 7: Viewing in 3-D

GEOMETRIC TRANSFORMATIONS AND VIEWING

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

Lecture 4: Viewing. Topics:

Computer Viewing. CITS3003 Graphics & Animation. E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley

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

Three-Dimensional Viewing Hearn & Baker Chapter 7

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

Three Main Themes of Computer Graphics

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Chapter 5. Projections and Rendering

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

Game Architecture. 2/19/16: Rasterization

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

Viewing and Projection

Shadows in Computer Graphics

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

Models and Architectures

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

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

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

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

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

COMP3421. Introduction to 3D Graphics

Today s Agenda. Geometry

Introduction to Computer Graphics 5. Clipping

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

Announcement. Project 1 has been posted online and in dropbox. Due: 11:59:59 pm, Friday, October 14

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

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

COMP3421. Introduction to 3D Graphics

3-Dimensional Viewing

Lecture 4: 3D viewing and projections

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

CS451Real-time Rendering Pipeline

Prof. Feng Liu. Fall /19/2016

Viewing and Projection

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

CS 4204 Computer Graphics

Viewing. Cliff Lindsay, Ph.D. WPI

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

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

Rasterization Overview

Viewing/Projection IV. Week 4, Fri Jan 29

Institutionen för systemteknik

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

Projections. Brian Curless CSE 457 Spring Reading. Shrinking the pinhole. The pinhole camera. Required:

Geometry: Outline. Projections. Orthographic Perspective

蔡侑庭 (Yu-Ting Tsai) National Chiao Tung University, Taiwan. Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification

CSC 305 The Graphics Pipeline-1

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

Viewing/Projections III. Week 4, Wed Jan 31

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

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

Models and The Viewing Pipeline. Jian Huang CS456

OpenGL Transformations

Perspective matrix, OpenGL style

COMS 4160: Problems on Transformations and OpenGL

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

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks)

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

Viewing and Projection

CS 4620 Midterm 1. Tuesday 22 October minutes

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

CS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo)

Transcription:

Computer Graphics 3. Viewing in 3D (b) Course no. DIS4566 National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: E.Angel, Interactive Computer Graphics, 4 th Ed., Addison Wesley

Projection of triangles A D A D C B focus C B Projection plane

Clipping

Clipping Clipping planes

OpenGL Orthogonal Viewing glortho(left,right,bottom,top,near, far) near and far measured from camera

OpenGL Perspective glfrustum(left,right,bottom,top,near,far

Using Field of View With glfrustum it is often difficult to get the desired view gluperpective(fovy, aspect, near, far) often provides a better interface front plane aspect = w/h

Visibility If we draw triangles directly, our screen will be a mess. Remove hidden surfaces.

Visibility (cont.) Remove hidden surfaces.

Pipeline View model-view transformation nonsingular projection transformation perspective division 4D 3D clipping against default cube projection 3D 2D

Normalization Rather than derive a different projection matrix for each type of projection, we can convert all projections to orthogonal projections with the default view volume This strategy allows us to use standard transformations in the pipeline and makes for efficient clipping

Normalization Figures from Stamminger M. and Drettakis G, Perspective Shadow Map

Notes 4D homogeneous coordinates through both the model-view and projection transformations Both these transformations are nonsingular Default to identity matrices (orthogonal view) Normalization lets us clip against simple cube regardless of type of projection Delay final projection until end Important for hidden-surface removal to retain depth information as long as possible

Orthogonal Normalization glortho(left,right,bottom,top,near,far) normalization find transformation to convert specified clipping volume to default

Orthogonal Matrix Two steps Move center to origin T(-(left+right)/2, -(bottom+top)/2,(near+far)/2)) Scale to have sides of length 2 S(2/(left-right),2/(top-bottom),2/(near-far)) P = ST = 2 right left 2 top bottom 2 near far right left right left top + bottom top bottom far + near far near 1

Final Projection Set z = Equivalent to the homogeneous coordinate transformation M orth = 1 1 Hence, general orthogonal projection in 4D is P = M orth ST 1

Simple Perspective Consider a simple perspective with the COP at the origin, the near clipping plane at z = -1, and a 9 degree field of view determined by the planes x = ±z, y = ±z

Perspective Matrices Simple projection matrix in homogeneous coordinates M = 1 1 1 1 Note that this matrix is independent of the far clipping plane

Generalization N = 1 1 α β 1 after perspective division, the point (x, y, z, 1) goes to x = x/z y = y/z Z = -(α+β/z) which projects orthogonally to the desired point regardless of α and β

Normalization Transformation distorted object projects correctly original clipping volume original object new clipping volume

Picking α and β If we pick α = β = near + far far near 2near far near far the near plane is mapped to z = -1 the far plane is mapped to z =1 and the sides are mapped to x = ± 1, y = ± 1 Hence the new clipping volume is the default clipping volume

Normalization and Hidden- Surface Removal if z 1 > z 2 in the original clipping volume then the for the transformed points z 1 > z 2 Hidden surface removal works if we first apply the normalization transformation However, the formula z = -(α+β/z) implies that the distances are distorted by the normalization which can cause numerical problems especially if the near distance is small

Why do we do it this way? Normalization allows for a single pipeline for both perspective and orthogonal viewing We stay in four dimensional homogeneous coordinates as long as possible to retain three-dimensional information needed for hidden-surface removal and shading We simplify clipping