Computer Graphics. Viewing. Fundamental Types of Viewing. Perspective views. Parallel views. October 12, finite COP (center of projection)

Similar documents
Realtime 3D Computer Graphics Virtual Reality

Fundamental Types of Viewing

Lecture 4: Viewing. Topics:

What is Perspective?

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

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

Transformations (Rotations with Quaternions) October 24, 2005

MAP. Vectors and Transforms. Reading instructions Quick Repetition of Vector Algebra. In 3D Graphics. Repetition of the Rendering Pipeline

Viewing Transformations I Comp 535

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

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

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

Chap 7, 2009 Spring Yeong Gil Shin

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

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

5.8.3 Oblique Projections

Remember: The equation of projection. Imaging Geometry 1. Basic Geometric Coordinate Transforms. C306 Martin Jagersand

Image Formation. 2. Camera Geometry. Focal Length, Field Of View. Pinhole Camera Model. Computer Vision. Zoltan Kato

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

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

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

Realtime 3D Computer Graphics & Virtual Reality. Viewing

To Do. Computer Graphics (Fall 2004) Course Outline. Course Outline. Motivation. Motivation

Introduction to Computer Graphics 4. Viewing in 3D

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

CS 450: COMPUTER GRAPHICS 2D TRANSFORMATIONS SPRING 2016 DR. MICHAEL J. REALE

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

Chap 7, 2008 Spring Yeong Gil Shin

CS 428: Fall Introduction to. Geometric Transformations. Andrew Nealen, Rutgers, /15/2010 1

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

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

Viewing with Computers (OpenGL)

Raster Graphics Algorithms

Viewing. Cliff Lindsay, Ph.D. WPI

Camera Models. Acknowledgements Used slides/content with permission from

Computer Graphics Chapter 7 Three-Dimensional Viewing Viewing

Graphics Pipeline : Geometric Operations

Viewing and Modeling

Announcements. Equation of Perspective Projection. Image Formation and Cameras

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

CPSC 314, Midterm Exam 1. 9 Feb 2007

Three-Dimensional Viewing Hearn & Baker Chapter 7

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

part 3 Martin Samuelčík Room I4

Viewing/Projection IV. Week 4, Fri Jan 29

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

Viewing/Projections III. Week 4, Wed Jan 31

2D and 3D Viewing Basics

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

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

Computer Viewing Computer Graphics I, Fall 2008

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

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

6. Modelview Transformations

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

CS 543: Computer Graphics. Projection

λ = What About Elementary Inverses? Transformations II Scale Inverse Shear Inverse λ = λ 0 1 CS Scale Shear CS5600 Computer Graphics by

Chapter 8 Three-Dimensional Viewing Operations

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

Vectors and Transforms

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

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

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

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

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

Vectors and Transforms

Viewing. Reading: Angel Ch.5

Viewing and Projection

Modeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益

Viewing and Projection

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

3-Dimensional Viewing

CS452/552; EE465/505. Models & Viewing

CPSC 314, Midterm Exam. 8 March 2013

Reading for This Module. Viewing. Using Transformations. Viewing. University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013

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

What does OpenGL do?

Announcements. The equation of projection. Image Formation and Cameras

Computer Graphics. Chapter 10 Three-Dimensional Viewing

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

Modeling Transformations

Geometry: Outline. Projections. Orthographic Perspective

Modeling Transformations

Homographies and Mosaics

521493S Computer Graphics Exercise 3 (Chapters 6-8)

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

Order of Transformations

Chapter 5-3D Camera & Optimizations, Rasterization

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

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

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

Viewing and Projection

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

CS5620 Intro to Computer Graphics

Viewing/Projections IV. Week 4, Fri Feb 1

News. Projections and Picking. Transforming View Volumes. Projections recap. Basic Perspective Projection. Basic Perspective Projection

PHOTOINTERPRETATION AND SMALL SCALE STEREOPLOTTING WITH DIGITALLY RECTIFIED PHOTOGRAPHS WITH GEOMETRICAL CONSTRAINTS 1

Building Models. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

3D Computer Vision Camera Models

Transcription:

Comuter Grahics Viewing October 2, 25 htt://www.hallm.ac.kr/~sunkim/teach/25/cga Funamental Tes of Viewing Persective views finite COP (center of rojection) Parallel views COP at infinit DOP (irection of rojection) ersective view arallel view htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Parallel View htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Persective View htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Classical Viewing Secific relationshi between the objects an the viewers htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Orthograhic Projections Projectors are erenicular to the rojection lane reserving both istances an angles orthograhic rojections temle an three multiview orthograhic rojections htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Aonometric Projections (/2) Projection lane can have an orientation with resect to the object rojectors are still orthogonal to the rojection lanes construction to view sie view htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Aonometric Projections (2/2) Preserve arallel lines but not angles isometric rojection lane is lace smmetricall with resect to the three rincial faces imetric two of rincial faces trimetric general case htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Aonometric Projections (2/2) Preserve arallel lines but not angles isometric rojection lane is lace smmetricall with resect to the three rincial faces imetric two of rincial faces trimetric general case htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Oblique Projections Projectors can make an arbitrar angle with the rojection lane reserving angels in lanes arallel to the rojection lane construction to view sie view htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Persective Projections (/2) Diminution of sie when objects are move father from the viewer, their images become smaller htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Persective Projections (2/2) One-, two-, an three-oint ersectives how man of the three rincial irections in the object are arallel to the rojection lane vanishing oints three-oint ersective two-oint ersective one-oint ersective htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Persective Projections (2/2) One-, two-, an three-oint ersectives how man of the three rincial irections in the object are arallel to the rojection lane vanishing oints three-oint ersective two-oint ersective one-oint ersective htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Persective Projections (2/2) One-, two-, an three-oint ersectives how man of the three rincial irections in the object are arallel to the rojection lane vanishing oints three-oint ersective two-oint ersective one-oint ersective htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Persective Projections (2/2) One-, two-, an three-oint ersectives how man of the three rincial irections in the object are arallel to the rojection lane vanishing oints three-oint ersective two-oint ersective one-oint ersective htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Positioning of the Camera (/3) OenGL laces a camera at the origin of the worl frame ointing in the negative irection moving the camera awa from the objects gltranslatef(.,., -); initial configuration after change in the moel-view matri htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Positioning of the Camera (2/3) Looking at the same object from the ositive ais translation after rotation b 9 egrees about the ais glmatrimoe(gl_modelview); glloaientit( ); ); gltranslatef(.,., -); glrotatef(-9.,.,.,.); htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Positioning of the Camera (3/3) Creating an isometric view of the cube M TR R 6 / 3 3 / 3 3 / 3 6 / 3 2 / 2 2 / 2 2 / 2 2 / 2 (,, ) (,, 2) (,, 2) view from ositive ais view from ositive ais view from ositive ais htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Positioning of the Camera (3/3) Creating an isometric view of the cube glmatrimoe(gl_modelview); glloaientit( ); ); gltranslatef(.,., -); glrotatef(35.26,.,.,.); glrotatef(45.,.,.,.); (,, ) (,, 2) (,, 3) view from ositive ais view from ositive ais htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Look-At Function OenGL utilit function glulookat(ee, ee, ee, at, at, at, u, u, u); ee-osition, target-osition, an u-vector look-at ositioning htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

htt://www.hallm.ac.kr/~sunkim/teach/25/g htt://www.hallm.ac.kr/~sunkim/teach/25/cga Simle Persective Projections (/2) Simle camera rojection lane is orthogonal to ais rojection lane in front of COP three-imensional view to view sie view, /, / htt://www.hallm.ac.kr/~sunkim/teach/25/g htt://www.hallm.ac.kr/~sunkim/teach/25/cga Simle Persective Projections (2/2) Homogeneous coorinates Persective rojection matri w w w w / / / / / / / M rojection ieline Moel-view Moel-view Projection Projection Persective ivision Persective ivision

htt://www.hallm.ac.kr/~sunkim/teach/25/g htt://www.hallm.ac.kr/~sunkim/teach/25/cga Simle Orthogonal Projections Projectors are erenicular to the view lane Orthograhic rojection matri htt://www.hallm.ac.kr/~sunkim/teach/25/g htt://www.hallm.ac.kr/~sunkim/teach/25/cga Projections in OenGL Angle of view onl objects that fit within the angle of view of the camera aear in the image View volume being clie out of scene frustum truncate rami

Persective in OenGL (/2) Secification of a frustum glmatrimoe(gl_projection); glloaientit( ); ); glfrustum(min, ma, min, ma, near, far); near, far: ositive number!! ma far min near htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Persective in OenGL (2/2) Secification using the fiel of view glmatrimoe(gl_projection); glloaientit( ); ); glupersective(fov, asect, near, far); fov: angle between to an bottom lanes fov: the angle of view in the u () irection asect ratio: with ivie b height htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Parallel in OenGL Orthograhic viewing function glmatrimoe(gl_projection); glloaientit( ); ); glortho(min, ma, min, ma, near, far); OenGL rovies onl this arallel-viewing function near < far!! no restriction on the sign ma far min near htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Walking Though a Scene (/2) voi kes(unsigne char ke, int, int ) { if(ke ) viewer[] -.; if(ke X ) viewer[] +.; if(ke ) viewer[] -.; if(ke Y ) viewer[] +.; if(ke ) viewer[2] -.; if(ke Z ) viewer[2] +.; } voi isla(voi) { glclearcolor(.f,.f,.f,.f); glclear(gl_color_buffer_bit GL_DEPTH_BUFFER_BIT); glmatrimoe(gl_modelview); glloaientit(); glulookat(viewer[], viewer[], viewer[2],,,,,,); glrotatef(theta[],.,.,.); glrotatef(theta[],.,.,.); glrotatef(theta[2],.,.,.); } colorcube( ); glutswabuffers( ); htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Walking Though a Scene (2/2) voi mreshae(int w, int h) { glmatrimoe(gl_projection); glloaientit( ); glviewort(,, w, h); if( w < h ) glfrustum(-2., 2., -2.*(GLfloat)h/(GLfloat)w, 2.*(GLfloat)h/(GLfloat)w, 2., 2.); else glfrustum(-2. *(GLfloat)w/(GLfloat)h, 2. *(GLfloat)w/(GLfloat)h, -2., 2., 2., 2.); } return; htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Projections & Shaows (/2) Shaow olgon Stes light source at ( l, l, l ) translation (- l, - l, - l ) ersective rojection through the origin translation ( l, l, l ) M T PT l l l / l l l l htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g

Projections & Shaows (2/2) GLfloat m[6]; /* shaow rojection matri */ for(i; i<6; i++) m[i].; m[] m[5] m[].; m[7] -./l; glcolor3fv(olgon_color); glbegin(gl_polygon);.. /* raw the olgon normall */. glen( ); glpushmatri( ); /* save state */ gltranslatef(l, l, l); /* translate back */ glmultmatrif(m); /* roject */ gltranslatef(-l, -l, -l); /* move light to origin */ glcolorfv(shaow_color); glbegin(gl_polygon);.. /* raw the olgon again */. glen( ); glpomatri( ); /* restore state */ htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g Shaows from a Cube onto Groun htt://www.hallm.ac.kr/~sunkim/teach/25/cga htt://www.hallm.ac.kr/~sunkim/teach/25/g