Three-Dimensional Viewing Hearn & Baker Chapter 7

Similar documents
Introduction to Computer Graphics 4. Viewing in 3D

Chapter 8 Three-Dimensional Viewing Operations

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

Viewing. Reading: Angel Ch.5

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

Overview. By end of the week:

Computer Graphics. Chapter 10 Three-Dimensional Viewing

Chap 7, 2008 Spring Yeong Gil Shin

Chapter 5. Projections and Rendering

Computer Graphics Chapter 7 Three-Dimensional Viewing Viewing

Chap 7, 2009 Spring Yeong Gil Shin

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

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

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

CSE328 Fundamentals of Computer Graphics

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

15. Clipping. Projection Transformation. Projection Matrix. Perspective Division

Projection Lecture Series

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

3-Dimensional Viewing

COMP30019 Graphics and Interaction Perspective Geometry

Computer Graphics 7: Viewing in 3-D

CSE452 Computer Graphics

Viewing with Computers (OpenGL)

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

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)

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

Lecture 4. Viewing, Projection and Viewport Transformations

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

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

COMP30019 Graphics and Interaction Perspective & Polygonal Geometry

Fundamental Types of Viewing

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

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

CS 4204 Computer Graphics

Lecture 4: Viewing. Topics:

Computer Graphics: Two Dimensional Viewing

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

3D Viewing. CS 4620 Lecture 8

CS 325 Computer Graphics

Models and The Viewing Pipeline. Jian Huang CS456

THE VIEWING TRANSFORMATION

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

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

CS488. Implementation of projections. Luc RENAMBOT

Viewing/Projections IV. Week 4, Fri Feb 1

(Refer Slide Time: 00:01:26)

1 OpenGL - column vectors (column-major ordering)

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

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

Geometry: Outline. Projections. Orthographic Perspective

CSCI 4620/8626. The 2D Viewing Pipeline

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

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

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

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

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

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

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

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

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

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

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

5.8.3 Oblique Projections

7. 3D Viewing. Projection: why is projection necessary? CS Dept, Univ of Kentucky

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

Game Architecture. 2/19/16: Rasterization

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

Computer Graphics Viewing

Prof. Feng Liu. Fall /19/2016

Lecture 4: 3D viewing and projections

Two Dimensional Viewing

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

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

INTRODUCTION TO COMPUTER GRAPHICS. cs123. It looks like a matrix Sort of. Viewing III. Projection in Practice 1 / 52

Viewing COMPSCI 464. Image Credits: Encarta and

OpenGL Transformations

Computer Vision Project-1

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

Viewing and Projection Transformations

CS2401 COMPUTER GRAPHICS ANNA UNIV QUESTION BANK

Perspective projection and Transformations

Viewing and Projection

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

UNIT 2 2D TRANSFORMATIONS

CSC 305 The Graphics Pipeline-1

CSC 470 Computer Graphics. Three Dimensional Viewing

UNIT - V PERSPECTIVE PROJECTION OF SIMPLE SOLIDS

COMP3421. Introduction to 3D Graphics

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

Graphics pipeline and transformations. Composition of transformations

Answer Key: Three-Dimensional Cross Sections

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

Viewing and Projection

Rasterization Overview

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

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

2D and 3D Viewing Basics

Transcription:

Three-Dimensional Viewing Hearn & Baker Chapter 7

Overview 3D viewing involves some tasks that are not present in 2D viewing: Projection, Visibility checks, Lighting effects, etc.

Overview First, set up viewing (or camera) coordinate reference The position and orientation for a view plane (or projection plane) that corresponds to a camera film plane Figure 1-1 Coordinate reference for obtaining a selected view of a three-dimensional scene.

Projections Parallel projection As used in engineering and architectural drawings Shows accurate dimensions Perspective projection Objects far away are shown smaller than nearby same size objects Figure 1-2 Three parallel-projection views of an object, showing relative proportions from different viewing positions.

Depth Cueing Depth info is important to identify viewing direction Depth cueing: Vary the brightness of lines according to distance

3D Viewing Pipeline Choose a viewing position (place the camera) Decide on camera orientation Direction and rotation (up direction) Figure 1-5 Photographing a scene involves selection of the camera position and orientation.

3D Viewing Pipeline Some viewing operations in 3D are same as in 2D 2D viewport, 2D clipping window, etc. Some are different Even though clipping window is 2D on the view plane, the scene is clipped against a volume (view volume)

3D Viewing Pipeline Figure 1-6 General three-dimensional transformation pipeline, from modeling coordinates (MC) to world coordinates (WC) to viewing coordinates (VC) to projection coordinates (PC) to normalized coordinates (NC) and, ultimately, to device coordinates (DC).

3D Viewing-Coordinate Parameters Select View point (or viewing position, eye position, camera position) P =(x,y,z ) View-up vector V to define y view Direction to define z view Figure 1-7 A right-handed viewing-coordinate system, with axes x view, y view, and z view, relative to a right-handed world-coordinate frame.

The View-Plane Normal Vector Viewing direction is along z view axis So, view plane (or projection plane) is normally perpendicular to this axis Orientation of the view plane (and direction of positive z view axis) can be defined by a view-plane normal vector N Figure 1-8 Orientation of the view plane and view-plane normal vector N.

The View-Plane Normal Vector Then, a scalar parameter is used to set the position of the view plane at coordinate z vp along z view axis Figure 1-9 Three possible positions for the view plane along the z view axis.

The View-Up Vector After view plane normal N, we choose a direction for view-up vector V (used to determine positive y view ) V should be perpendicular to N Viewing routines typically adjust user-defined V Often, V=(,1,) is a convenient choice Figure 1-11 Adjusting the input direction of the view-up vector V to an orientation perpendicular to the view-plane normal vector N.

The uvn Viewing-Coordinate Reference Frame Right-handed viewing systems are more common, but sometimes left-handed viewing systems are used In left-handed viewing systems viewing direction is towards the positive z view direction Left-handed coordinate references are often used to represent screen coordinates and for the normalization transformation

The uvn Viewing-Coordinate Reference Frame View-plane normal N defines z view axis direction View-up vector V is used to obtain y view axis direction We need to determine x view axis direction cross product of N and V gives U in x view axis direction cross product of N and U gives adjusted V u, v, n are unit vectors in directions U, V, N Figure 1-12 A right-handed viewing system defined with unit vectors u, v, and n.

Generating 3D Viewing Effects By varying viewing parameters, different viewing effects can be achieved

Translate viewing coordinate origin (P ) to the world coordinate origin Align x view, y view, z view with x w, y w, z w Transformation from World to Viewing Coordinates 1 1 1 1 z y x T 1 z y x z y x z y x n n n v v v u u u R

The transformation matrix is the product of these translation and rotation matrices Transformation from World to Viewing Coordinates 1, P n n n n P v v v v P u u u u T R M z y x z y x z y x WC VC

Projection Transformations In parallel projection, coordinate positions are transferred to view plane along parallel lines orthogonal/orthographic oblique For perspective projection, coordinates are transferred to view plane along lines that converge at a point

Orthogonal Projections Projection along lines parallel to the viewplane normal N Front, side, rear orthogonal projections are often called elevations The top one is called plan view Figure 1-17 Orthogonal projections of an object, displaying plan and elevation views.

Axonometric and Isometric Orthogonal Projections. Orthogonal projections which show more than one face of an object are called axonometric orthogonal projections Isometric: Most common axonometric o.p.s that are generated by aligning projection plane so that it intersects principal axes at the same distance from origin

Orthogonal Projection Coordinates If projection direction is parallel to z view x p =x, y p =y z coordinate is kept for visibility detection procedures Figure 1-19 An orthogonal projection of a spatial position onto a view plane.

Clipping Window and Orthogonal Projection View Volume Edges of the clipping window specify the x and y limits These are used to form the top, bottom, and two sides of a clipping region called the orthogonalprojection view volume Limit the volume in z view direction by near-far (or front-back) clipping planes

Figure 1-22 A finite orthogonal view volume with the view plane in front of the near plane.

M ortho, norm Normalization Transformation for an Orthogonal Projection mapping coordinates into a normalized view volume with coordinates in the range -1 to 1 xw max 2 xw min yw max 2 yw min z near 2 z far xw xw yw yw z z max max max max near near xw xw yw yw z z 1 far far min min min min

Oblique Parallel Projections Projection path is not perpendicular to view plane It can be defined with a vector direction The effect is same as z-axis shearing transformation Figure 1-25 An oblique parallel projection of a cube, shown in a top view (a), produces a view (b) containing multiple surfaces of the cube.

Figure 1-32 Top view of an oblique parallel-projection transformation. The oblique view volume is converted into a rectangular parallelepiped, and objects in the view volume, such as the green block, are mapped to orthogonalprojection coordinates.

Perspective Projections Project objects to view plane along converging paths to projection reference point (or center of projection) Figure 1-33 A perspective projection of two equallength line segments at different distances from the view plane.

x ' x ( x x ) prp u y ' y ( y y ) prp u u 1 z ' z ( z z ) prp u Perspective Projections On the viewplane, z =z vp. Solve this for u u z z vp prp z z Substitute this u into x and y equations x y p p z x z prp z y z prp prp prp z vp z z vp z x y prp prp z z z z vp prp vp prp z z z z If projection reference point is on z view If it is at origin x p z x z vp y p z y z vp x p z x z prp prp z vp z y p z y z prp prp z vp z Figure 1-34 A perspective projection of a point P with coordinates (x, y, z) to a selected projection reference point. The intersection position on the view plane is (x p, y p, z vp ).

Figure 1-35 A perspective-projection view of an object is upside down when the projection reference point is between the object and the view plane.

Figure 1-36 Changing perspective effects by moving the projection reference point away from the view plane.

Vanishing Points Lines parallel to view plane are still parallel But, other lines parallel to each other are now converging The point such lines converge at are vanishing points Vanishing points for lines parallel to principal axes are principal vanishing points How many principal v.p.s can be seen depends on projection plane orientation 1-point, 2-point, or 3-point projections

Perspective Projection View Volume An infinite pyramid of vision is chopped off by near and far clipping planes and we get a truncated pyramid (or frustum)

Perspective-Projection Transformation Matrix Cannot directly apply a matrix and get the result 2 steps are required First, calculate the homogeneous coordinates using perspective projection matrix P h =M pers P Then, after normalization and clipping, divide by h (homogeneous parameter, h=z prp -z) s z (scaling) and t z (translation) factors for normalizing projected z coordinate values (they depend on the selected normalization range M pers z prp z vp z prp z vp x y s z prp prp 1 x y prp prp z t z z z prp prp prp

Symmetric Perspective Projection Frustum If the line from perspective reference point through clipping window center (centerline) is perpendicular to view plane, we have a symmetric frustum Clipping window can be specified by width and height, or field-of-view angle and aspect ratio With a symmetric frustum, perspective transformation is a mapping to orthogonal coordinates (figure on next slide)

Figure 1-44 A symmetric frustum view volume is mapped to an orthogonal parallelepiped by a perspective-projection transformation.

Oblique Perspective-Projection Frustum Centerline not perpendicular to view plane First, transform this into a symmetric frustum (z-axis shearing) Then proceed as before

Viewport Transformation and 3D Screen Coordinates Once we have normalized projection coordinates, clipping can be done on the symmetric cube (or unit cube) After clipping, cube contents can be transferred to screen coordinates For x and y, same as in 2D Depth info (z coordinates) must be retained for visibility testing and surface rendering

3D Clipping Algorithms No matter what the projection details were, we now have a normalized cube, so we clip against planes parallel to Cartesian planes (either at coordinates and 1, or -1 and 1) The task is to identify object sections within the cube (save parts inside and eliminate parts outside) Algorithms are extensions of the 2D algorithms

3D Region Codes The idea is the same as in 2D (we added 2 more bits for near and far planes) A point is now P=(x h,y h,z h,h) h can be a value other than 1 (in perspective projection), so, the inequalities to be satisfied are -1<=x h /h<=1-1<= y h /h<=1-1<= z h /h<=1

3D Region Codes h values should be nonzero and often positive (these can be easily checked) So, our inequalities become -h <= x h <= h, -h <= y h <= h, and -h <= z h <= h And bit values can be decided by bit 1 = 1 if h + x h < bit 2 = 1 if h - x h < bit 3 = 1 if h + y h < bit 4 = 1 if h - y h < bit 5 = 1 if h + z h < bit 6 = 1 if h - z h < (left) (right) (bottom) (top) (near) (far)

Figure 1-5 Values for the three-dimensional, six-bit region code that identifies spatial positions relative to the boundaries of a view volume.

Figure 1-51 Three-dimensional region codes for two line segments. Line P 1 P 2 intersects the right and top clipping boundaries of the view volume, while line P 3 P 4 is completely below the bottom clipping plane.

Figure 1-52 Three-dimensional object clipping. Surface sections that are outside the view-volume clipping planes are eliminated from the object description, and new surface facets may need to be constructed.

Figure 1-53 Clipping a line segment against a plane with normal vector N.

Figure 1-54 Clipping the surfaces of a pyramid against a plane with normal vector N. The surfaces in front of the plane are saved, and the surfaces of the pyramid behind the plane are eliminated.