Computer Graphics 7: Viewing in 3-D

Similar documents
Computer Graphics: Viewing in 3-D. Course Website:

Computer Graphics Viewing

GEOMETRIC TRANSFORMATIONS AND VIEWING

Viewing with Computers (OpenGL)

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

Computer Graphics: Geometric Transformations

Three-Dimensional Viewing Hearn & Baker Chapter 7

Overview. By end of the week:

Transformations Computer Graphics I Lecture 4

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM

Institutionen för systemteknik

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

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

CSE328 Fundamentals of Computer Graphics

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

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

Game Architecture. 2/19/16: Rasterization

Transformations Computer Graphics I Lecture 4

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

Lecture 4. Viewing, Projection and Viewport Transformations

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

UNIT 2 2D TRANSFORMATIONS

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

CS 4204 Computer Graphics

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

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

Chapter 8 Three-Dimensional Viewing Operations

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

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

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

2D and 3D Transformations AUI Course Denbigh Starkey

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

DD2429 Computational Photography :00-19:00

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

Models and The Viewing Pipeline. Jian Huang CS456

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

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

Chap 7, 2008 Spring Yeong Gil Shin

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

Scene Modeling for a Single View

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

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

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

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

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

Hello, welcome to the video lecture series on Digital Image Processing. So in today's lecture

CS 4204 Computer Graphics

CS Computer Graphics: Transformations & The Synthetic Camera

Prof. Feng Liu. Fall /19/2016

2D Object Definition (1/3)

Rasterization Overview

UNIT 2. Translation/ Scaling/ Rotation. Unit-02/Lecture-01

OpenGL Matrix/Vector Manipulation using SFML

The Graphics Pipeline and OpenGL I: Transformations!

MAE : Lecture #12 - Projection and Perspective. Lecture Overview:

2D transformations: An introduction to the maths behind computer graphics

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

Shadows in Computer Graphics

CSC 305 The Graphics Pipeline-1

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

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

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

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

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

Computer Graphics. Chapter 7 2D Geometric Transformations

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping

Chapter 5. Projections and Rendering

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

CS488. Implementation of projections. Luc RENAMBOT

1 Projective Geometry

Computer Science 336 Fall 2017 Homework 2

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

Introduction to Computer Graphics 4. Viewing in 3D

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

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

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

Computer Viewing Computer Graphics I, Fall 2008

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

Computer Vision Systems. Viewing Systems Projections Illuminations Rendering Culling and Clipping Implementations

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

A Basic Flight Simulator in Excel #3 calculating the

Chap 7, 2009 Spring Yeong Gil Shin

IMAGE-BASED RENDERING AND ANIMATION

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

1 OpenGL - column vectors (column-major ordering)

COMP3421. Introduction to 3D Graphics

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

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

Computer Graphics. Chapter 10 Three-Dimensional Viewing

3D Transformation. In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. x y z. x y z. glvertex3f(x, y,z);

3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy

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

The diagram above shows a sketch of the curve C with parametric equations

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

Transformations. CSCI 420 Computer Graphics Lecture 4

Overview. Affine Transformations (2D and 3D) Coordinate System Transformations Vectors Rays and Intersections

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

Viewing. Reading: Angel Ch.5

Transcription:

Computer Graphics 7: Viewing in 3-D

In today s lecture we are going to have a look at: Transformations in 3-D How do transformations in 3-D work? Contents 3-D homogeneous coordinates and matrix based transformations Projections History Geometrical Constructions Types of Projection Projection in Computer Graphics

3-D Coordinate Spaces Remember what we mean by a 3-D coordinate space y axis y P z axis z x x axis Right-Hand Reference System

Translations In 3-D To translate a point in three dimensions by dx, dy and dz simply calculate the new points as follows: x = x + dx y = y + dy z = z + dz (x, y, z) (x, y, z ) Translated Position

Scaling In 3-D To sale a point in three dimensions by sx, sy and sz simply calculate the new points as follows: x = sx*x y = sy*y z = sz*z (x, y, z) (x, y, z ) Scaled Position

Rotations In 3-D (cont ) The equations for the three kinds of rotations in 3-D are as follows: x = x cosθ - y sinθ y = x sinθ + y cosθ z = z x = x y = y cosθ - z sinθ z = y sinθ + z cosθ x = z sinθ + x cosθ y = y z = z cosθ - x sinθ

Homogeneous Coordinates In 3-D Similar to the 2-D situation we can use homogeneous coordinates for 3-D transformations - 4 coordinate y axis column vector All transformations can then be represented as matrices P(x, y, z) = x y z 1 z axis z y P x x axis

3D Transformation Matrices 1 1 1 1 dz dy dx 1 z y x s s s Translation by dx, dy, dz Scaling by sx, sy, sz 1 1 1 cos sin 1 sin cos θ θ θ θ 1 cos sin sin cos 1 θ θ θ θ Rotate About X-Axis 1 1 cos sin sin cos θ θ θ θ Rotate About Y-Axis Rotate About Z-Axis

Remember The Big Idea

1 of 23 Viewing a 3D world Display plane World coordinate frame Camera position (or eye point, view point, viewing position)

(Variation of Fig 7-11, pg. 299) 3D Viewing Pipeline Modeling coordinates Construct World Coordinate Scene Using Model- Coordinate Transformations Convert World Coordinates to Viewing Coordinates Transform Viewing Coordinates to Normalized Coordinates Modeling coordinates World coordinates Viewing coordinates 2D pipeline 3D pipeline Construct World Coordinate Scene Using Model- Coordinate Transformations World coordinates Convert World Coordinates to Viewing Coordinates Projection Transformation Transform Viewing Coordinates to Normalized Coordinates Viewing coordinates Projection coordinates Normalized coordinates Normalized coordinates Map Normalized Coordinates to Device Coordinates Map Normalized Coordinates to Device Coordinates Device coordinates Device coordinates

What Are Projections? Our 3-D scenes are all specified in 3-D world coordinates To display these we need to generate a 2-D image - project objects onto a picture plane Picture Plane Objects in World Space So how do we figure out these projections?

Converting From 3-D To 2-D Projection is just one part of the process of converting from 3-D world coordinates to a 2-D image 3-D world coordinate output primitives Clip against view volume Project onto projection plane Transform to 2-D device coordinates 2-D device coordinates

Projections Need to project from 3D to 2D 2 kinds of projection Parallel projection Perspective projection

Parallel Projection

Perspective Projection

Types Of Projections There are two broad classes of projection: Parallel: Typically used for architectural and engineering drawings Perspective: Realistic looking and used in computer graphics Parallel Projection Perspective Projection

Types Of Projections (cont ) For anyone who did engineering or technical drawing

Parallel Projections Some examples of parallel projections Orthographic Projection Isometric Projection

Perspective Projections There are a number of different kinds of perspective views The most common are one-point and two point perspectives One Point Perspective Projection Two-Point Perspective Projection

Elements Of A Perspective Projection Virtual Camera

Projection of up vector Up vector Position The Up And Look Vectors Look vector camera is rotated The look vector indicates the direction in which the camera is pointing The up vector determines how the For example, is the camera held vertically or horizontally

In today s lecture we looked at: Transformations in 3-D Very similar to those in 2-D Projections Summary 3-D scenes must be projected onto a 2-D image plane Lots of ways to do this Parallel projections Perspective projections The virtual camera

Perspective Projections Remember the whole point of perspective projections

Setting Up A Perspective Projection We need one more thing to specify a perspective projections using the filed of view angle (cont ) The aspect ratio gives the ratio between the width sand height of the view plane

Contents Now lecture we are going to have a look at some perspective view demos and investigate how clipping works in 3-D Nate Robins OpenGL tutorials The clipping volume The zone labelling scheme 3-D clipping Point clipping Line clipping Polygon clipping

3-D Clipping Just like the case in two dimensions, clipping removes objects that will not be visible from the scene The point of this is to remove computational effort 3-D clipping is achieved in two basic steps Discard objects that can t be viewed i.e. objects that are behind the camera, outside the field of view, or too far away Clip objects that intersect with any clipping plane

Discard Objects Discarding objects that cannot possibly be seen involves comparing an objects bounding box/sphere against the dimensions of the view volume Can be done before or after projection

Clipping Objects Objects that are partially within the viewing volume need to be clipped just like the 2D case

Normalisation The transformed volume is then normalised around position (,, ) and the z axis is reversed

Dividing Up The World Similar to the case in two dimensions, we divide the world into regions This time we use a 6-bit region code to give us 27 different region codes The bits in these regions codes are as follows: bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 Far Near Top Bottom Right Left

Region Codes

3D Line Clipping Example (cont ) When then simply continue as per the two dimensional line clipping algorithm

3D Polygon Clipping However the most common case in 3D clipping is that we are clipping graphics objects made up of polygons

3D Polygon Clipping (cont ) In this case we first try to eliminate the entire object using its bounding volume Next we perform clipping on the individual polygons using the Sutherland-Hodgman algorithm we studied previously

Summary In today s lecture we examined how clipping is achieved in 3-D