Prof. Feng Liu. Fall /17/2016

Similar documents
Computer Graphics and Animation 3-Viewing

17/5/2009. Introduction

5. Geometric Transformations and Projections

CS-184: Computer Graphics. Today. Lecture #5: 3D Transformations and Rotations. Transformations in 3D Rotations

2D Transformations. Why Transformations. Translation 4/17/2009

Coordinate Systems. Ioannis Rekleitis

Augmented Reality. Integrating Computer Graphics with Computer Vision Mihran Tuceryan. August 16, 1998 ICPR 98 1

10/29/2010. Rendering techniques. Global Illumination. Local Illumination methods. Today : Global Illumination Modules and Methods

(a, b) x y r. For this problem, is a point in the - coordinate plane and is a positive number.

Positioning of a robot based on binocular vision for hand / foot fusion Long Han

Goal. Rendering Complex Scenes on Mobile Terminals or on the web. Rendering on Mobile Terminals. Rendering on Mobile Terminals. Walking through images

A Mathematical Implementation of a Global Human Walking Model with Real-Time Kinematic Personification by Boulic, Thalmann and Thalmann.

CSE 165: 3D User Interaction

4.2. Co-terminal and Related Angles. Investigate

Massachusetts Institute of Technology Department of Mechanical Engineering

Environment Mapping. Overview

ANNOUNCEMENT. LECTURE 25 Spherical Refracting Surfaces

EYE DIRECTION BY STEREO IMAGE PROCESSING USING CORNEAL REFLECTION ON AN IRIS

CALCULUS III Surface Integrals. Paul Dawkins

Journal of World s Electrical Engineering and Technology J. World. Elect. Eng. Tech. 1(1): 12-16, 2012

Lecture 27: Voronoi Diagrams

Topic -3 Image Enhancement

Introduction to Medical Imaging. Cone-Beam CT. Introduction. Available cone-beam reconstruction methods: Our discussion:

Color Correction Using 3D Multiview Geometry

Extended Perspective Shadow Maps (XPSM) Vladislav Gusev, ,

View Synthesis using Depth Map for 3D Video

3D Reconstruction from 360 x 360 Mosaics 1

Motion Estimation. Yao Wang Tandon School of Engineering, New York University

Where am I? Using Vanishing Points

2. PROPELLER GEOMETRY

Viewing COMPSCI 464. Image Credits: Encarta and

Physical simulation for animation

ME 210 Applied Mathematics for Mechanical Engineers

A Novel Automatic White Balance Method For Digital Still Cameras

All lengths in meters. E = = 7800 kg/m 3

A Shape-preserving Affine Takagi-Sugeno Model Based on a Piecewise Constant Nonuniform Fuzzification Transform

Detection and Recognition of Alert Traffic Signs

Segmentation of Casting Defects in X-Ray Images Based on Fractal Dimension

Output Primitives. Ellipse Drawing

Image Enhancement in the Spatial Domain. Spatial Domain

A New and Efficient 2D Collision Detection Method Based on Contact Theory Xiaolong CHENG, Jun XIAO a, Ying WANG, Qinghai MIAO, Jian XUE

Haptic Glove. Chan-Su Lee. Abstract. This is a final report for the DIMACS grant of student-initiated project. I implemented Boundary

AUTOMATED LOCATION OF ICE REGIONS IN RADARSAT SAR IMAGERY

CS464 Oct 3 rd Assignment 3 Due 10/6/2017 Due 10/8/2017 Implementation Outline

Computer Graphics. - Shading - Hendrik Lensch. Computer Graphics WS07/08 Light Transport

Adaptation of Motion Capture Data of Human Arms to a Humanoid Robot Using Optimization

ISyE 4256 Industrial Robotic Applications

Derivation of the Nodal Forces Equivalent to Uniform Pressure for Quadratic Isoparametric Elements RAWB, Last Update: 30 September 2008

t [ Background removed

Where am I? Using Vanishing Points

Mono Vision Based Construction of Elevation Maps in Indoor Environments

Monte Carlo Techniques for Rendering

Conservation Law of Centrifugal Force and Mechanism of Energy Transfer Caused in Turbomachinery

Illumination methods for optical wear detection

Voting-Based Grouping and Interpretation of Visual Motion

9-2. Camera Calibration Method for Far Range Stereovision Sensors Used in Vehicles. Tiberiu Marita, Florin Oniga, Sergiu Nedevschi

Topological Characteristic of Wireless Network

CS 548: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE

Ego-Motion Estimation on Range Images using High-Order Polynomial Expansion

CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2016 DR. MICHAEL J. REALE

Lecture 5: Rendering Equation Chapter 2 in Advanced GI

A Novel Image-Based Rendering System With A Longitudinally Aligned Camera Array

Layered Animation using Displacement Maps

Improved Fourier-transform profilometry

Lecture # 04. Image Enhancement in Spatial Domain

Image Acquisition and Camera Model

Lecture 3: Rendering Equation

Elliptic Generation Systems

Haptic Simulation of a Tool In Contact With a Nonlinear Deformable Body

Optical Flow for Large Motion Using Gradient Technique

Heterogeneous Isotropic BRDFs. Homogeneous BRDF. Spatially Varying BRDF. Approaches - Sampling. Approaches - Illumination

Cellular Neural Network Based PTV

Title. Author(s)NOMURA, K.; MOROOKA, S. Issue Date Doc URL. Type. Note. File Information

Multi-azimuth Prestack Time Migration for General Anisotropic, Weakly Heterogeneous Media - Field Data Examples

Extracting Articulation Models from CAD Models of Parts with Curved Surfaces

Complete Solution to Potential and E-Field of a sphere of radius R and a charge density ρ[r] = CC r 2 and r n

A Neural Network Model for Storing and Retrieving 2D Images of Rotated 3D Object Using Principal Components

ART GALLERIES WITH INTERIOR WALLS. March 1998

DEADLOCK AVOIDANCE IN BATCH PROCESSES. M. Tittus K. Åkesson

Stereo and 3D Reconstruction

Obstacle Avoidance of Autonomous Mobile Robot using Stereo Vision Sensor

Tufts University Math 13 Department of Mathematics November 14, :00 noon to 1:20 pm

3D Periodic Human Motion Reconstruction from 2D Motion Sequences

Journal of Machine Engineering, Vol. 15, No. 4, 2015

A Haptic-Assisted Guidance System for Navigating Volumetric Data Sets

Shape Matching / Object Recognition

Assessment of Track Sequence Optimization based on Recorded Field Operations

Desired Attitude Angles Design Based on Optimization for Side Window Detection of Kinetic Interceptor *

Multiview plus depth video coding with temporal prediction view synthesis

= dv 3V (r + a 1) 3 r 3 f(r) = 1. = ( (r + r 2

EQUATIONS can at times be tedious to understand

A modal estimation based multitype sensor placement method

Image-processing Based Panoramic Camera Employing Single Fisheye Lens

FACE VECTORS OF FLAG COMPLEXES

Lecture 8 Introduction to Pipelines Adapated from slides by David Patterson

sf3 RESTRICTED QUADTREE (VON HERZEN/BARR)

Elastohydrodynamic Lubrication Analysis of Journal Bearings Using CAD

Several algorithms exist to extract edges from point. system. the line is computed using a least squares method.

Reader & ReaderT Monad (11A) Young Won Lim 8/20/18

Introduction To Robotics (Kinematics, Dynamics, and Design)

Transcription:

Pof. Feng Liu Fall 26 http://www.cs.pdx.edu/~fliu/couses/cs447/ /7/26

Last time Compositing NPR 3D Gaphics Toolkits Tansfomations 2

Today 3D Tansfomations The Viewing Pipeline Mid-tem: in class, Nov. 2 Homewok 3 available, due Octobe 3, in class 3

Homogeneous Coodinates Use thee numbes to epesent a 2D point (x,y)=(wx,wy,w) fo any constant w Typically, (x,y) becomes (x,y,) To go backwads, divide by w Tanslation can now be done with matix multiplication! 4

Basic Tansfomations Tanslation: Rotation: Scaling: 5 y x b b y x s s cos sin sin cos

Homogeneous Tansfom Advantages Unified view of tansfomation as matix multiplication Easie in hadwae and softwae To compose tansfomations, simply multiply matices Ode mattes: AB is geneally not the same as BA Allows fo non-affine tansfomations: Pespective pojections! 6

Diections vs. Points We have been talking about tansfoming points Diections ae also impotant in gaphics Viewing diections (,) Nomal vectos (-2,-) Ray diections Diections ae epesented by vectos, like points, and can be tansfomed, but not like points 7

Tansfoming Diections Say I define a diection as the diffeence of two points: d=a b This epesents the diection of the line between two points Now I tanslate the points by the same amount: a =a+t, b =b+t How should I tansfom d? 8

Homogeneous Diections Tanslation does not affect diections! Homogeneous coodinates give us a vey clean way of handling this The diection (x,y) becomes the homogeneous diection (x,y,) The coect thing happens fo otation and scaling also Unifom scaling changes the length of the vecto, but not the diection 9 y x y x b b y x

3D Tansfomations Homogeneous coodinates: (x,y,z)=(wx,wy,wz,w) Tansfomations ae now epesented as 4x4 matices Typical gaphics packages allow fo specification of tanslation, otation, scaling and abitay matices OpenGL: gltanslate[fd], glrotate[fd], glscale[fd], glmultmatix[fd]

3D Tanslation z y x t t t z y x z y x

3D Rotation Rotation in 3D is about an axis in 3D space passing though the oigin Using a matix epesentation, any matix with an othonomal top-left 3x3 sub-matix is a otation Rows ae mutually othogonal ( dot poduct) Deteminant is Implies columns ae also othogonal, and that the tanspose is equal to the invese 2

3D Rotation 3.,,,, then and if 3 2 3 2 3 2 etc z y x R z y x z y x zz zy zx yz yy yx xz xy xx

Poblems with Rotation Matices Specifying a otation eally only equies 3 numbes Axis is a unit vecto, so equies 2 numbes Angle to otate is thid numbe Rotation matix has a lage amount of edundancy Othonomal constaints educe degees of feedom back down to 3 Rotations ae a vey complex subject, and a detailed discussion is way beyond the scope of this couse 4

Altenative Repesentations Specify the axis and the angle (OpenGL method) Eule angles: Specify how much to otate about X, then how much about Y, then how much about Z Had to think about, and had to compose Any thee axes will do e.g. X,Y,Z Specify the axis, scaled by the angle Only 3 numbes, called the exponential map Quatenions 5

Quatenions 4-vecto elated to axis and angle, unit magnitude Rotation about axis (n x,n y,n z ) by angle : cos / 2,sin / 2 nx cos / 2, ny cos / 2, nz Reasonably easy to compose Reasonably easy to go to/fom otation matix Only nomalized quatenions epesent otations, but you can nomalize them just like vectos, so it isn t a poblem Easy to pefom spheical intepolation 6

Othe Rotation Issues Rotation is about an axis at the oigin Fo otation about an abitay axis, use the same tick as in 2D: Tanslate the axis to the oigin, otate, and tanslate back again Rotation is not commutative Rotation ode mattes Expeiment to convince youself of this 7

Tansfomation Leftoves Scale, shea etc extend natually fom 2D to 3D Rotation and Tanslation ae the igid-body tansfomations: Do not change lengths o angles, so a body does not defom when tansfomed 8

Modeling Fo the moment assume that all geomety consists of points, lines and faces Line: A segment between two endpoints Face: A plana aea bounded by line segments Any face can be tiangulated (boken into tiangles) 9

Image ul: http://www.capcom-cental.com/concept/e4/leonwiefame.jpg 2

Modeling and OpenGL In OpenGL, all geomety is specified by stating which type of object and then giving the vetices that define it glbegin() glend() glvetex[34][fdv] Thee o fou components (egula o homogeneous) Float, double o vecto (eg float[3]) Chapte 2 of the OpenGL ed book 2

Rendeing Geneate an image showing the contents of some egion of space The egion is called the view volume, and it is defined by the use Detemine whee each object should go in the image Viewing, Pojection Detemine which pixels should be filled Rasteization Detemine which object is in font at each pixel Hidden suface elimination, Hidden suface emoval, Visibility Detemine what colo it is Lighting, Shading 22

Gaphics Pipeline Gaphics hadwae employs a sequence of coodinate systems The location of the geomety is expessed in each coodinate system in tun, and modified along the way The movement of geomety though these spaces is consideed a pipeline Local Coodinate Space Wold Coodinate Space View Space Canonical View Volume Display Space 23

Local Coodinate Space It is easiest to define individual objects in a local coodinate system Fo instance, a cube is easiest to define with faces paallel to the coodinate axes Key idea: Object instantiation Define an object in a local coodinate system Use it multiple times by copying it and tansfoming it into the global system This is the only effective way to have libaies of 3D objects 24

Wold Coodinate System Eveything in the wold is tansfomed into one coodinate system - the wold coodinate system It has an oigin, and thee coodinate diections, x, y, and z Lighting is defined in this space The locations, bightness and types of lights The camea is defined with espect to this space Some highe level opeations, such as advanced visibility computations, can be done hee 25

View Space Define a coodinate system based on the eye and image plane the camea The eye is the cente of pojection, like the apetue in a camea The image plane is the oientation of the plane on which the image should appea, like the film plane of a camea Some camea paametes ae easiest to define in this space Focal length, image size Relative depth is captued by a single numbe in this space 26

Canonical View Volume Canonical View Space: A cube, with the oigin at the cente, the viewe looking down z, x to the ight, and y up Canonical View Volume is the cube: [-,] [-,] [-,] Vaiants (late) with viewe looking down +z and z fom - Only things that end up inside the canonical volume can appea in the window Tasks: Paallel sides and unit dimensions make many opeations easie Clipping decide what is in the window Rasteization - decide which pixels ae coveed Hidden suface emoval - decide what is in font Shading - decide what colo things ae 27

Window Space Window Space: Oigin in one cone of the window on the sceen, x and y match sceen x and y Windows appea somewhee on the sceen Typically you want the thing you ae dawing to appea in you window But you may have no contol ove whee the window appeas You want to be able to wok in a standad coodinate system you code should not depend on whee the window is You taget Window Space, and the windowing system takes cae of putting it on the sceen 28

Gaphics Pipeline Local Coodinate Space Wold Coodinate Space View Space Canonical View Volume Display Space 29

Canonical Window Tansfom Poblem: Tansfom the Canonical View Volume into Window Space (eal sceen coodinates) Dop the depth coodinate and tanslate The gaphics hadwae and windowing system typically take cae of this but we ll do the math to get you wamed up The windowing system adds one final tansfomation to get you window on the sceen in the ight place 3

Canonical Window Tansfom Typically, windows ae specified by a cone, width and height Cone expessed in tems of sceen location This epesentation can be conveted to (x min,y min ) and (x max,y max ) We want to map points in Canonical View Space into the window Canonical View Space goes fom (-,-,-) to (,,) Lets say we want to leave z unchanged What basic tansfomations will be involved in the total tansfomation fom 3D sceen to window coodinates? 3

Canonical Window Tansfom (,) (x max,y max ) (x min,y min ) (-,-) Canonical view volume Window space 32

Canonical Window Tansfom (,) (x max,y max ) (x min,y min ) (-,-) x y z pixel pixel pixel xmax xmin 2 xmax xmin y y 2 y y max min max min 2x 2 y z canonical canonical canonical 33

Canonical Window Tansfom You almost neve have to woy about the canonical to window tansfom In OpenGL, you tell it which pat of you window to daw in elative to the window s coodinates That is, you tell it whee to put the canonical view volume You must do this wheneve the window changes size Window (not the sceen) has oigin at bottom left glviewpot(minx, miny, maxx, maxy) Typically: glviewpot(,, width, height)fills the entie window with the image Some textbook deives a diffeent tansfom, but the same idea 34

glviewpot(,, width, height) 35

glviewpot(,, width, height) 36

Gaphics Pipeline Local Coodinate Space Wold Coodinate Space View Space Canonical View Volume Display Space 37

View Volumes Only stuff inside the Canonical View Volume gets dawn Points too close o too fa away will not be dawn But, it is inconvenient to model the wold as a unit box A view volume is the egion of space we wish to tansfom into the Canonical View Volume fo dawing Only stuff inside the view volume gets dawn Descibing the view volume is a majo pat of defining the view 38

Othogaphic Pojection Othogaphic pojection pojects all the points in the wold along paallel lines onto the image plane Pojection lines ae pependicula to the image plane Like a camea with infinite focal length The esult is that paallel lines in the wold poject to paallel lines in the image, and atios of lengths ae peseved This is impotant in some applications, like medical imaging and some compute aided design tasks

Othogaphic View Space View Space: a coodinate system with the viewe looking in the z diection, with x hoizontal to the ight and y up A ight-handed coodinate system! All ous will be The view volume is a ectilinea box fo othogaphic pojection The view volume has: a nea plane at z=n a fa plane at z=f, (f < n) a left plane at x=l a ight plane at x=, (>l) a top plane at y=t and a bottom plane at y=b, (b<t) z y x (,b,n) (l,t,f) 4

Rendeing the Volume To find out whee points end up on the sceen, we must tansfom View Space into Canonical View Space We know how to daw Canonical View Space on the sceen This tansfomation is pojection The mapping looks simila to the one fo Canonical to Window 4

Othogaphic Pojection Matix (Othogaphic View to Canonical Matix) 42 view canonical view canonical view view view canonical canonical canonical z y x f n f n f n b t b t b t l l l f n b t l f n b t l z y x x M x 2 2 2 2 2 2 2 2 2

Gaphics Pipeline Local Coodinate Space Wold Coodinate Space View Space Canonical View Volume Display Space 43

Next Time Pespective Pojection Clipping 44