CSE528 Computer Graphics: Theory, Algorithms, and Applications

Similar documents
CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

Lecture 4: Viewing. Topics:

Chap 7, 2009 Spring Yeong Gil Shin

What does OpenGL do?

4. Two Dimensional Transformations

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides)

CSE328 Fundamentals of Computer Graphics

Transforms II. Overview. Homogeneous Coordinates 3-D Transforms Viewing Projections. Homogeneous Coordinates. x y z w

Chap 7, 2008 Spring Yeong Gil Shin

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

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

Viewing and Projection

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

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

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters

(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates

CS Computer Graphics: Transformations & The Synthetic Camera

Homogeneous Coordinates

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

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

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

Overview. By end of the week:

Transformations II. Week 2, Wed Jan 17

Image Warping. Some slides from Steve Seitz

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

CS559: Computer Graphics

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

5.8.3 Oblique Projections

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

3-Dimensional Viewing

Viewing. Cliff Lindsay, Ph.D. WPI

Realtime 3D Computer Graphics & Virtual Reality. Viewing

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

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

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

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

CPSC 314, Midterm Exam 1. 9 Feb 2007

Image Warping. Some slides from Steve Seitz

Transformations. Examples of transformations: shear. scaling

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

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

Viewing/Projection IV. Week 4, Fri Jan 29

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

Viewing with Computers (OpenGL)

CS F-07 Objects in 2D 1

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

GEOMETRIC TRANSFORMATIONS AND VIEWING

What and Why Transformations?

Viewing. Reading: Angel Ch.5

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

Image Warping (Szeliski Sec 2.1.2)

Chapter 8 Three-Dimensional Viewing Operations

CS4670: Computer Vision

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

Image Warping CSE399b, Spring 07 Computer Vision

3D Geometry and Camera Calibration

CS 112 The Rendering Pipeline. Slide 1

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

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

Modeling Transformations Revisited

Viewing/Projections III. Week 4, Wed Jan 31

Modeling Transformations

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

3D Coordinates & Transformations

Modeling Transformations

Scene Graphs & Modeling Transformations COS 426

3D Viewing Transformations

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

CPSC 314, Midterm Exam. 8 March 2013

2D and 3D Viewing Basics

CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

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

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

CS 325 Computer Graphics

CS251 Spring 2014 Lecture 7

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

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

Computer Viewing Computer Graphics I, Fall 2008

CS770/870 Spring 2017 Transformations

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

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

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

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

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

Viewing Transformations I Comp 535

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

The 3-D Graphics Rendering Pipeline

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

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

Two Dimensional Viewing

Warping, Morphing and Mosaics

Modeling Transformations

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

Models and The Viewing Pipeline. Jian Huang CS456

Editing and Transformation

Three Main Themes of Computer Graphics

Modeling Transformations

3D Viewing Episode 2

Transcription:

CSE528 Computer Graphics: Theor, Algorithms, and Applications Hong Qin State Universit of New York at Ston Brook (Ston Brook Universit) Ston Brook, New York 794--44 Tel: (63)632-845; Fa: (63)632-8334 qin@cs.sunsb.edu http://www.cs.sunsb.edu/~qin

Transformation and Viewing

Cartesian Coordinate Sstem Left Handed +Y +Y +Z -Z -X +X -X +X +Z -Y -Z -Y Right Handed CSE53, SUNYSB-CS SPRING, 2

Euclidean Space Scalars Points: P = (,,) Vectors: V = [,,] Magnitude or distance V = ( 2 + 2 + 2 ) Direction No position Position vector Think of as magnitude and distance relative to a point, usuall the origin of the coordinate sstem CSE528, SUNYSB-CS

Review of Common Vector Operations in 3D Addition of vectors V +V 2 = [,, ] + [ 2, 2, 2 ] = [ + 2, + 2, + 2 ] Multipl a scalar times a vector sv = s[,,] = [s,s,s] Dot Product V V 2 = [,, ][ 2, 2, 2 ] = [ 2 + 2 + 2 ] V V 2 = V v 2 cos where is the angle between V and V 2 Cross Product of two vectors V V 2 = [,, ][ 2, 2, 2 ] = [ 2-2, 2-2, 2-2 ] = - V 2 V Results in a vector that is orthogonal to the plane defined b V and V 2 CSE528, SUNYSB-CS

2D Geometric Transformations Translation Rotation Scaling Shear Homogenous Coordinates Matri Representations Composite Transformations

Translation =+t =+t (, ) ' ' t t (,)

Rotation = cos - sin = sin + cos ' ' cos sin sin cos (, ) (,)

Scaling =S =S (, ) ' ' S S (,)

Shear = + h = ' ' h

Homogenous Coordinates Each position (, ) is represented as (,, ). All transformations can be represented as matri multiplication. Composite transformation becomes easier.

Translation in Homogenous Coordinates =+t =+t P = (,) P = (, ) ' ' t t P = T(t, t ) P

Rotation in Homogenous Coordinates = cos - sin = sin + cos ' ' cos sin sin cos P = (, ) P = (,) P = R( ) P

=s =s (,) (, ) ' ' s s Scaling in Homogenous Coordinates P = S(s, s ) P

= + h = ' ' h Shear in Homogenous Coordinates P = SH P

2D Geometric Transformations Translation Rotation Scaling Shear Homogenous Coordinates Composite Transformations

2D Geometric Transformations Translation Rotation Scaling Shear Homogenous Coordinates Composite Transformations Rotation about a fied point

Rotation About a Fied Point. Translate the object to the origin. ( r, r ) 2. Rotate around the origin. 3. Translate the object back.

Rotation About a Fied Point ( r, r ). Translate the object to the origin

Rotation About a Fied Point 2. Rotate about origin

Rotation About a Fied Point ( r, r ) 3. Translate the object back

Rotation About a Fied Point. Translate the object to the origin. 2. Rotate around the origin. 3. Translate the object back. cos sin sin cos r r r r ( r, r ) P = T( r, r ) R( ) T(- r, - r ) P T( r, r ) R( ) T(- r, - r )

3D Geometric Transformations Basic 3D Transformations Translation Rotation Scaling Shear Composite 3D Transformations Change of Coordinate sstems

Translation (,, ) (,, ) ' ' ' t t t P = T P

Rotation about -ais cos sin sin cos ' ' ' P = R () P

Rotation about -ais cos sin sin cos ' ' ' P = R () P

Rotation about -ais cos sin sin cos ' ' ' P = R () P

Rotation About a Fied Point. Translate the object to the origin. 2. Rotate about the three ais, respectivel. 3. Translate the object back. P = T ( r, r,, r ) R * R2 * R3 T (- r, - r,, - r ) P Ri = R (,i ) R (,i ) R (,i )

Rotation with Arbitrar Direction. We will have to translate an arbitrar vector so that its starting point starts from the origin 2. We will have to rotate w.r.t. -ais so that this vector stas on - plane 3. We will then rotate w.r.t. -ais so that this vector aligns with -ais 4. We will then rotate w.r.t. -ais 5. Reverse (3), (2), and ()

Scaling (,, ) (,, ) ' ' ' s s s P = S P

' ' ' h h Shear P = SH P

Change in Coordinate Sstems P = M P M can be a combination of translation, rotation and scaling.

Taking a Picture with a Camera Geometric Coordinate Sstems: Local, World, Viewing Graphics Rendering Pipeline ModelView Matri operations on models World coordinates to Viewing coordinates Matri operations (models or cameras) Projection with a camera

Viewing in 3D Planar Geometric Projections Parallel Orthographic Projections Perspective Projections Projections in OpenGL Clipping

Planar Geometric Projections Maps points from camera coordinate sstem to the screen (image plane of the virtual camera). Planar Geometric Projections Parallel Perspective Oblique Orthographic Image Plane Image Plane Center of Projection (COP)

Parallel Orthographic Projection Preserves X and Y coordinates. Preserves both distances and angles. Image Plane

Parallel Orthographic Projection p p p (,, ) p = p = p = ( p, p, ) =

Perspective Projection Onl preserves parallel lines that are parallel to the image plane. Line segments are shorten b distance. Image Plane Center of Projection (COP)

Perspective Projection (,, ) ( p, p, p ) = d

Perspective Projection p = d p = ( d) / ( p, d) (, ) = d

Perspective Projection p = d p = ( d) / ( p, d) (, ) = d

Perspective Projection p = ( d) / =/(/ d) p = ( d) / =/(/ d) p = d =/(/ d) / d h h h h h h h h h h h h p p p / / / /

Viewing in 3D Planar Geometric Projections Parallel Orthographic Projections Perspective Projections Projections in OpenGL

Viewing in 3D Planar Geometric Projections Parallel Orthographic Projections Perspective Projections Projections in OpenGL Positioning of the Camera Define the view volume

Positioning the Camera B default, the camera is placed at the origin pointing towards the negative -ais.

Positioning the Camera OpenGL Look-At Function glulookat(ee, ee, ee, at, at, at, up, up, up) View-reference point (VRP) View-plane normal (VPN) View-up vector (VUP) (up, up, up) (at, at, at) (ee, ee, ee)

Defining the Perspective View Volume glfrustum(left, right, bottom, top, near, far) ( ma, ma, -far) ( min, min, -near)

Defining the Perspective View Volume gluperspective(fov, aspect, near, far) w h fov

Defining the Parallel View Volume glortho(min, ma, min, ma, near, far) ( ma, ma, -far) ( min, min, -near) View Volume