COMP30019 Graphics and Interaction Perspective & Polygonal Geometry

Similar documents
COMP30019 Graphics and Interaction Perspective Geometry

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

Graphics and Interaction Rendering pipeline & object modelling

Chapter 5. Projections and Rendering

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

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

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

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

Chapter 8 Three-Dimensional Viewing Operations

Three-Dimensional Viewing Hearn & Baker Chapter 7

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

(Refer Slide Time: 00:01:26)

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

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

Physics 1C Lecture 26A. Beginning of Chapter 26

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

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

COSC579: Scene Geometry. Jeremy Bolton, PhD Assistant Teaching Professor

Raycasting. Chapter Raycasting foundations. When you look at an object, like the ball in the picture to the left, what do

So we have been talking about 3D viewing, the transformations pertaining to 3D viewing. Today we will continue on it. (Refer Slide Time: 1:15)

Viewing with Computers (OpenGL)

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

Introduction to Computer Graphics 4. Viewing in 3D

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

Chap 7, 2008 Spring Yeong Gil Shin

Figure 1. Lecture 1: Three Dimensional graphics: Projections and Transformations

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

Models and The Viewing Pipeline. Jian Huang CS456

CS 4204 Computer Graphics

CS 354R: Computer Game Technology

CS602- Computer Graphics Solved MCQS From Midterm Papers. MIDTERM EXAMINATION Spring 2013 CS602- Computer Graphics

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

Specifying Complex Scenes

Chapter 23. Geometrical Optics (lecture 1: mirrors) Dr. Armen Kocharian

3D Rendering and Ray Casting

Vision Review: Image Formation. Course web page:

Projection Lecture Series

Three Main Themes of Computer Graphics

Topics and things to know about them:

Viewing and Projection Transformations

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

3D Viewing. CS 4620 Lecture 8

CHAPTER 1 Graphics Systems and Models 3

Lecture Outline Chapter 26. Physics, 4 th Edition James S. Walker. Copyright 2010 Pearson Education, Inc.

Game Architecture. 2/19/16: Rasterization

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Rasterization Overview

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

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

Models and Architectures

Pipeline Operations. CS 4620 Lecture 10

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

Geometry: Outline. Projections. Orthographic Perspective

L1 - Introduction. Contents. Introduction of CAD/CAM system Components of CAD/CAM systems Basic concepts of graphics programming

3D Rendering and Ray Casting

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

5.8.3 Oblique Projections

CS 325 Computer Graphics

Midterm Exam! CS 184: Foundations of Computer Graphics! page 1 of 14!

Viewing. Reading: Angel Ch.5

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

CSE328 Fundamentals of Computer Graphics

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

CS488. Implementation of projections. Luc RENAMBOT

Reflection & Mirrors

Overview. By end of the week:

Computer Graphics Chapter 7 Three-Dimensional Viewing Viewing

Computer Graphics 7: Viewing in 3-D

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

Shadows in the graphics pipeline

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

Homogeneous Coordinates. Lecture18: Camera Models. Representation of Line and Point in 2D. Cross Product. Overall scaling is NOT important.

Overview: Ray Tracing & The Perspective Projection Pipeline

Virtual Environments

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

Chapter 36. Image Formation

Pin Hole Cameras & Warp Functions

Viewing Transformation

Chap 7, 2009 Spring Yeong Gil Shin

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Welcome to: Physics I. I m Dr Alex Pettitt, and I ll be your guide!

Pipeline Operations. CS 4620 Lecture 14

Graphics and Interaction Surface rendering and shading

Lecture outline Graphics and Interaction Surface rendering and shading. Shading techniques. Introduction. Surface rendering and shading

Computer Graphics Viewing

Chapter 7: Geometrical Optics. The branch of physics which studies the properties of light using the ray model of light.

The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

Optics II. Reflection and Mirrors

Introduction to Computer Graphics with WebGL

34.2: Two Types of Image

Introduction to 3D Concepts

Image Formation. Antonino Furnari. Image Processing Lab Dipartimento di Matematica e Informatica Università degli Studi di Catania

Practical Linear Algebra: A Geometry Toolbox

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

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

Computer Graphics. Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D)

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

Transcription:

COMP30019 Graphics and Interaction Perspective & Polygonal Geometry Department of Computing and Information Systems The

Lecture outline Introduction Perspective Geometry Virtual camera Centre of projection Classes of projection Polygonal geometry

Perspective geometry How are three-dimensional objects projected onto two-dimensional images? Aim: understand point-of-view, projective geometry.

Viewing

Viewport

Geometry of image formation Mapping from 3D space to 2D image surface, moving from a higher dimensional image to a lower dimensional image The X, Y, Z points in the three dimensional world, sometimes called voxels, are transformed in to x, y pixels in a two-dimensional image. More specifically, a mapping from 3D directions, rays of light, to/from the observer.

Pinhole Camera projection screen for image (maybe translucent waxed paper) light ray from object image of object (upside down) pinhole in box light-tight box object in 3D scene

Perspective geometry (X,Y,Z) f X x O Z

Perspective geometry Basically an abstraction of pin-hole camera. Look at XOZ plane (same thing happens in YOZ plane). Actual point in 3D space is (X, Y, Z ) 0 is origin (focal point) or centre of projection. Z is distance from actual point to origin. f is focal distance (focal length). x is the image (upside down) with respect to real world.

Perspective of virtual camera

Virtual camera geometry (X,Y,Z) f X x O Z

Virtual camera geometry Image projection surface imagined to be in front of projection centre. Geometrically equivalent Often more convenient to think about projection

Perspective Formulas Point P = (X, Y, Z ) in 3D space has projection (x, y) in the image where or x f y f = X Z = Y Z x = Xf Z y = Yf Z f being the focal distance (sometimes f is called d). Look at similar triangles in the previous diagram.

Perspective Formulas Look at perspective projection diagram to convince yourself of this triangles xof and XOZ have the same proportions. Rearranging gives equations shown on previous slide. These formulas apply only for camera-centred coordinates, for which perspective projection has a particularly simple form. For arbitrarily centred coordinate systems 3D transformations are necessary (more on this when we tackle 3D transformations using matrices).

Centre of projection A A Projectors Center of projection A' (a) B' B Projection plane Center of projection at infinity Projectors (b) A' B' B Projection plane (Foley, Figure 6.03)

One point perspective projection z-axis vanishing point y y z-axis vanishing point z x z x (Foley, Figure 6.04)

One-point perspective projection Projection plane y Center of projection z x Projection plane normal (Foley, Figure 6.05)

Two-point perspective

Three-point perspective

Vanishing points In 3D, parallel lines meet only at infinity, so the vanishing point can be thought of as the projection of a point at infinity. If the set of lines is parallel to one of the three principal axes, the vanishing point is called an axis vanishing point. So called one-point, two-point, and three-point perspectives are just special cases of perspective projection, depending on how image plane lines up with significant planes in scene. In fact, there are an infinity of vanishing points, one for each of the infinity of directions in which a line can be oriented.

Perspective of the human eye Human eye effectively uses a kind of spherical projection: Retina is curved, though projection centre (in lens) isn t at centre of the eyeball (therefore not planar geometric projection). Doesn t exactly match perspective projection. Only a problem for very wide fields of view. Perspective is basically the right projection for putting a 3D scene onto a flat surface for human viewing. Other projections are possible for special effects, e.g. fish-eye lens.

Classes of projection Subclasses of planar geometric projections Planar geometric projections Parallel Perspective Orthographic Oblique One-point Top (plan) Cabinet Front elevation Side Axonometric Cavalier elevation Isometric Other Other Two-point Three-point (Foley, Figures 6.21 & 6.22)

House example y (0, 10, 54) (8, 16, 30) (16, 10, 30) (16, 0, 30) x (16, 0, 54) z (Foley, Figure 6.4)

One-point, centred perspective projection example y x v (Foley, Figures 6.21 & 6.22) VRP z n VUP VPN DOP PRP = (8, 6, 30) CW u Window on view plane Which of the below is the centre of project in the Figure? Is the view plane inbetween the centre of projection and the house or behind the centre of projection? VRP (view reference point) PRP (projection reference point) VPN (view plane normal) DOP (direction of projection) VUP (view-up vector)

Two-point perspective projection example In a two-point projection of a house, left, the viewplane (defined by the view plane normal, VPN), right, cuts both the z and x axes View plane y v x u z VPN (Foley Figures 6.17 and 6.25).

Ortographic (parallel) projection Parallel projection (also known as orthographic projection) is given by x = X y = Y That is, just drop Z coordinate!

Perspective Geometry Summary Perspective geometry is based loosely on the pin-hole camera model that maps 3D points onto a 2D image plane The image plane may thought of either behind a focal point or in between a vanishing point and the object. Computer graphics largely concerns planar geometric projections, generally perspective projection and sometimes parallel projection for specific applications. One-point, two-point and three-point projection variants arise according to how many times the viewplane cuts the axis.

Perspective Geometry in Unity Unity tutorials (getting started; perspective in Unity): https://unity3d.com/learn/tutorials Roll-a-Ball tutorial (is excellent) https://unity3d.com/learn/tutorials/projects/ roll-ball-tutorial Github for Unity s official Roll-a-ball tutorial: https://github.com/nicksuch/roll-a-ball Unity manual(s): https://docs.unity3d.com/manual/

Polygonal geometry In general a polygon is any plane figure bounded by straight line segments and but can comprise these forms polygonal arcs (polylines) polygonal boundaries (closed polylines) and filled polygons Polygons are very useful, both in themselves and as building blocks for approximating arbitrary curved arcs and regions.

Representation Either as a set of line segments, or an ordered sequence of vertices using absolute or relative coordinates, Walking order convention often applies, e.g. anti-clockwise for outer and clockwise for inner

Polygon mesh: vertex list V 2 V 1 P 1 P 2 V 3 V 4 V = (V 1, V 2, V 3, V 4 ) = ((x 1, y 1, z 1 ),..., (x 4, y 4, z 4 )) P 1 = (1, 2, 4) P 2 = (4, 2, 3)

Polygon mesh: edge list V = (V 1, V 2, V 3, V 4 ) = ((x 1, y 1, z 1 ),, (x 4, y 4, z 4 )) E 1 V 2 E 2 E 1 = (V 1, V 2, P 1, l) E 2 = (V 2, V 3, P 2, l) E 3 = (V 3, V 4, P 2, l) V 1 P 1 P 2 E 4 V 3 E 4 = (V 4, V 2, P 1, P 2 ) E 5 E 3 V 4 E 5 = (V 4, V 1, P 1, l) P 1 = (E 1, E 4, E 5 ) P 2 = (E 2, E 3, E 4 ) Polygons represented as line segments, edges can make polygon clipping and scan-line filling operations easier.

Polygon types Convex Non-simple Star Concave Multiple-boundary

Polygon Properties In a convex polygon no internal angle is greater than 180 degrees In a concave polygon there are internal angles that can be greater than 180 degrees Concave polygons can be represented as a conjunction of convex polygons (convex polygons have certain properties that simplify geometric operations and tesselations).

Level of detail Example from Stanford University Computer Graphics Lab Programmer provides several different versions of an object for viewing at different distances. The figures (on the left), at a distance (on the right) they appear very similar (in spite of different numbers of polygons) (Images from Slater text)

Vertex spit method (Figure from Slater text)

Example of levels of detail

Polygonal Geometry Summary Polygons are one of the most widely used models in computer graphics and are useful for representing both two-dimensional shapes and three-dimensional objects. The rendering pipeline facilitates the systematic modelling, transfmation and rendering of polygons. Level-of-detail achieves higher performance, by adapting the number of polygons used.

Polygonal geometry in Unity & blender Unity uses the fbx (filmbox) file format If you click on models in Unity, it will launch Model Viewer in Visual Studio blender is more powerful and general blender uses the blend, file format You can import blender models into Unity, which invokes blenders fbx exporter