CENG 477 Introduction to Computer Graphics. Modeling Transformations

Similar documents
4.1 3D GEOMETRIC TRANSFORMATIONS

M y. Image Warping. Targil 7 : Image Warping. Image Warping. 2D Geometric Transformations. image filtering: change range of image g(x) = T(f(x))

Geometry Transformation

Systems & Biomedical Engineering Department. Transformation

geometric transformations

Gauss-Jordan Algorithm

Image warping Li Zhang CS559

CS 428: Fall Introduction to. Geometric Transformations (continued) Andrew Nealen, Rutgers, /20/2010 1

Image warping/morphing

EECS 487: Interactive Computer Graphics

Projection & Interaction

Shortest Path Algorithms. Lecture I: Shortest Path Algorithms. Example. Graphs and Matrices. Setting: Dr Kieran T. Herley.

STEREO PLANE MATCHING TECHNIQUE

Fill in the following table for the functions shown below.

NEWTON S SECOND LAW OF MOTION

MATH Differential Equations September 15, 2008 Project 1, Fall 2008 Due: September 24, 2008

CAMERA CALIBRATION BY REGISTRATION STEREO RECONSTRUCTION TO 3D MODEL

Interactive Graphical Systems HT2005

4. Minimax and planning problems

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Fall 2012)

Projective geometry- 2D

Ray Casting. Outline. Outline in Code

Implementing Ray Casting in Tetrahedral Meshes with Programmable Graphics Hardware (Technical Report)

AML710 CAD LECTURE 11 SPACE CURVES. Space Curves Intrinsic properties Synthetic curves

A METHOD OF MODELING DEFORMATION OF AN OBJECT EMPLOYING SURROUNDING VIDEO CAMERAS

Sam knows that his MP3 player has 40% of its battery life left and that the battery charges by an additional 12 percentage points every 15 minutes.

MOTION DETECTORS GRAPH MATCHING LAB PRE-LAB QUESTIONS

A Matching Algorithm for Content-Based Image Retrieval

Image Content Representation

MARSS Reference Sheet

Section 2. Mirrors and Prism Systems

Spline Curves. Color Interpolation. Normal Interpolation. Last Time? Today. glshademodel (GL_SMOOTH); Adjacency Data Structures. Mesh Simplification

A NEW APPROACH FOR 3D MODELS TRANSMISSION

Chapter Six Chapter Six

Announcements For The Logic of Boolean Connectives Truth Tables, Tautologies & Logical Truths. Outline. Introduction Truth Functions

In fmri a Dual Echo Time EPI Pulse Sequence Can Induce Sources of Error in Dynamic Magnetic Field Maps

Coded Caching with Multiple File Requests

WORKSHOP SAFETY IN MOBILE APPLICATION

Curves & Surfaces. Last Time? Today. Readings for Today (pick one) Limitations of Polygonal Meshes. Today. Adjacency Data Structures

Introduction to Data-Driven Animation: Programming with Motion Capture Jehee Lee

Point Cloud Representation of 3D Shape for Laser- Plasma Scanning 3D Display

Today. Curves & Surfaces. Can We Disguise the Facets? Limitations of Polygonal Meshes. Better, but not always good enough

Computer representations of piecewise

Project #1 Math 285 Name:

Engineering Mathematics 2018

Numerical Solution of ODE

Scattering at an Interface: Normal Incidence

ME 406 Assignment #1 Solutions

An Improved Square-Root Nyquist Shaping Filter

Last Time: Curves & Surfaces. Today. Questions? Limitations of Polygonal Meshes. Can We Disguise the Facets?

parametric spline curves

Quantitative macro models feature an infinite number of periods A more realistic (?) view of time

Schedule. Curves & Surfaces. Questions? Last Time: Today. Limitations of Polygonal Meshes. Acceleration Data Structures.

Streamline Pathline Eulerian Lagrangian

In Proceedings of CVPR '96. Structure and Motion of Curved 3D Objects from. using these methods [12].

MB86297A Carmine Timing Analysis of the DDR Interface

Video Content Description Using Fuzzy Spatio-Temporal Relations

FLOW VISUALIZATION USING MOVING TEXTURES * Nelson Max Lawrence Livermore National Laboratory Livermore, California

Motion Estimation of a Moving Range Sensor by Image Sequences and Distorted Range Data

COMP26120: Algorithms and Imperative Programming

Overview. 9 - Game World: textures, skyboxes, etc. Texture Mapping. Texture Space. Vertex Texture Coordinates. Texture Mapping. Game World Backgrounds

Traditional Rendering (Ray Tracing and Radiosity)

Image Registration in Medical Imaging

The Roots of Lisp paul graham

Motor Control. 5. Control. Motor Control. Motor Control

1.4 Application Separable Equations and the Logistic Equation

1 œ DRUM SET KEY. 8 Odd Meter Clave Conor Guilfoyle. Cowbell (neck) Cymbal. Hi-hat. Floor tom (shell) Clave block. Cowbell (mouth) Hi tom.

Optics and Light. Presentation

It is easier to visualize plotting the curves of cos x and e x separately: > plot({cos(x),exp(x)},x = -5*Pi..Pi,y = );

Ray Tracing II. Improving Raytracing Speed. Improving Computational Complexity. Raytracing Computational Complexity

Landmarks: A New Model for Similarity-Based Pattern Querying in Time Series Databases

Assignment 2. Due Monday Feb. 12, 10:00pm.

COSC 3213: Computer Networks I Chapter 6 Handout # 7

Lecture 18: Mix net Voting Systems

Definition and examples of time series

A Principled Approach to. MILP Modeling. Columbia University, August Carnegie Mellon University. Workshop on MIP. John Hooker.

Probabilistic Detection and Tracking of Motion Discontinuities

Reconstruct scene geometry from two or more calibrated images. scene point. image plane. Reconstruct scene geometry from two or more calibrated images

NURBS rendering in OpenSG Plus

Robust 3D Visual Tracking Using Particle Filtering on the SE(3) Group

Rao-Blackwellized Particle Filtering for Probing-Based 6-DOF Localization in Robotic Assembly

Motion Level-of-Detail: A Simplification Method on Crowd Scene

Using CANopen Slave Driver

Upper Body Tracking for Human-Machine Interaction with a Moving Camera

Image Based Computer-Aided Manufacturing Technology

TUTORING TEXTS IN MATHCAD

Network management and QoS provisioning - QoS in Frame Relay. . packet switching with virtual circuit service (virtual circuits are bidirectional);

Mass-Spring Systems and Resonance

Low-Cost WLAN based. Dr. Christian Hoene. Computer Science Department, University of Tübingen, Germany

Visual Indoor Localization with a Floor-Plan Map

EXPERIMENTAL RESULTS GOT WITH THE OMNIDIRECTIONAL VISION SENSOR: SYCLOP

MIC2569. Features. General Description. Applications. Typical Application. CableCARD Power Switch

Proceeding of the 6 th International Symposium on Artificial Intelligence and Robotics & Automation in Space: i-sairas 2001, Canadian Space Agency,

THE goal of this work is to develop statistical models for

LAMP: 3D Layered, Adaptive-resolution and Multiperspective Panorama - a New Scene Representation

Design Alternatives for a Thin Lens Spatial Integrator Array

Why not experiment with the system itself? Ways to study a system System. Application areas. Different kinds of systems

Learning Topological Image Transforms Using Cellular Simultaneous Recurrent Networks

THE micro-lens array (MLA) based light field cameras,

RULES OF DIFFERENTIATION LESSON PLAN. C2 Topic Overview CALCULUS

Transcription:

CENG 477 Inroducion o Compuer Graphics Modeling Transformaions

Modeling Transformaions Model coordinaes o World coordinaes: Model coordinaes: All shapes wih heir local coordinaes and sies. world World coordinaes: All shapes wih heir absolue coordinaes and sies. world world CENG 477 Compuer Graphics

Basic Geomeric Transformaions Used for modeling, animaion as well as viewing Wha o ransform? We picall ransform he verices (poins) and vecors describing he shape (such as he surface normal) This works due o he lineari of ransformaions Some, bu no all, ransformaions ma preserve aribues like sies, angles, raios of he shape CENG 477 Compuer Graphics 3

Translaion Simpl move he objec o a relaive posiion ' + ' + ' T ' ' ' ' + T CENG 477 Compuer Graphics 4

Roaion A roaion is defined b a roaion ais and a roaion angle For D roaion, he parameers are roaion angle () and he roaion poin ( r, r ) We reposiion he objec in a circular pah around he roaion poin (pivo poin) r a r CENG 477 Compuer Graphics 5

Roaion When ( r, r )(,) we have: ʹ r cos( φ + ) r cosφ cos r sinφ sin ʹ r sin( φ + ) r cosφ sin + r sinφ cos r cosφ The original coordinaes are: r sin φ ' Subsiuing hem in he firs equaion we ge: In he mari form we have: ʹ ʹ ʹ cos sin + R sin cos cos sin R sin cos CENG 477 Compuer Graphics 6

Roaion Roaion around an arbirar poin ( r, r ) ʹ ʹ r r + ( r + ( r )cos ( )sin + ( r r )sin )cos ( r, r ) ' These equaions can be wrien as mari operaions (we will see when we discuss homogeneous coordinaes) CENG 477 Compuer Graphics 7

Scaling Changes he sie of an objec Inpu: scaling facors (s, s ) ' s ' s ' S s s ' S non-uniform vs. uniform scaling CENG 477 Compuer Graphics 8

Homogenous Coordinaes Translaion is addiive, roaion and scaling is muliplicaive (and addiive if ou roae around an arbirar poin or scale around a fied poin) Goal: Make all ransformaions as mari operaions Soluion: Add a hird dimension h h h h h h h h h h CENG 477 Compuer Graphics 9

Homogenous Coordinaes In HC, each poin now becomes a line The enire line represens he same poin The original (non-homogeneous) poin resides on he w plane w All poins along his line in HC represen he same poin, p p p w CENG 477 Compuer Graphics

Transformaions in HC Translaion: Roaion: Scaling: ( ) ( ) where ', T, T ( ) ( ) cos sin sin cos where R R ' ( ) ( ) ʹ where s s,s s S,s s S CENG 477 Compuer Graphics

Transforming Vecors Vecors can be roaed and scaled Bu ranslaing a vecor does no change i! Wh? A vecor is a difference beween wo poins These wo poins ranslae he same wa So he vecor remains he same Mahemaicall his can be achieved b seing he las coordinae of a vecor o (he las coordinae of poins should be ) D poin in HC is equal o D vecor in HC is equal o CENG 477 Compuer Graphics

Composie Transformaions Ofen, objecs are ransformed muliple imes Such ransformaions can be combined ino a single composie ransformaion E.g. Applicaion of a sequence of ransformaions o a poin: ʹ M M M CENG 477 Compuer Graphics 3

Composie Transformaions Composiion of he same pes of ransformaions is simple E.g. ranslaion: ( ) ( ) ( ) +, + T, T, T + + T T T T ʹ )}, ( ), ( { } ), ( { ), ( CENG 477 Compuer Graphics 4

( ) ( ) ( ) s,s s s s s s s s s s s,s s,s s S S S ( ) ( ) ( ) +φ +φ +φ +φ +φ φ φ+ φ φ+ φ φ φ φ φ R R R ) cos( ) sin( ) sin( ) cos( cos cos sin sin sin cos cos sin cos sin sin cos sin sin cos cos cos sin sin cos cos sin sin cos ϕ ϕ ϕ ϕ Composie Transformaions Roaion and scaling are similar: CENG 477 Compuer Graphics 5

Roaion Around a ivo oin Sep : Translae he objec so ha he pivo poin moves o he origin (, ) T r r M T (, ) r r CENG 477 Compuer Graphics 6

Roaion Around a ivo oin Sep : Roae around origin R( ) M R( ) CENG 477 Compuer Graphics 7

Roaion Around a ivo oin Sep 3: Translae he objec so ha he pivo poin is back o is original posiion (, ) T r r M 3 T (, ) r r CENG 477 Compuer Graphics 8

Roaion Around a ivo oin The composie ransformaion is equal o heir successive applicaion: M (, ) R( ) (, ) M 3M M T T r r r r CENG 477 Compuer Graphics 9

Scaling w.r.. a Fied oin The idea is he same: Translae o origin Scale Translae back ( ) ( ) ( ) ( ) ( ) f f f f f f f f f f s s s s s s,,s s, T S T ( ) f f, T ( ) s, s S ( ) f f, T CENG 477 Compuer Graphics

Order of mari composiions Mari composiion is no commuaive. So, be careful when appling a sequence of ransformaions. ivo ivo Roaion and ranslaion Translaion and roaion CENG 477 Compuer Graphics

Oher Transformaions Reflecion: special case of scaling CENG 477 Compuer Graphics

Oher Transformaions Shear: Deform he shape like shifed slices (or deck of cards). Can be in or direcion (,) (,) (,) (3,) ' sh ' sh CENG 477 Compuer Graphics 3

3D Transformaions Similar o D bu wih an era componen We assume a righ handed coordinae ssem Wih homogeneous coordinaes we have 4 dimensions Basic ransformaions: Translaion, roaion, scaling Equivalen was of hinking abou a righ-handed CS CENG 477 Compuer Graphics 4

Translaion Move he objec b some offse: ʹ ʹ ʹ T ʹ ʹ CENG 477 Compuer Graphics 5

Roaion Roaion around he coordinae aes -ais -ais -ais osiive angles represen couner-clockwise (CCW) roaion when looking along he posiive half owards origin CENG 477 Compuer Graphics 6

Roaion Around Major Aes Around : Around : Around : cos sin sin cos ) ( R R ʹ ) ( cos sin sin cos ) ( R R ʹ ) ( cos sin sin cos ) ( R R ʹ ) ( CENG 477 Compuer Graphics 7

Roaion Around a arallel Ais Roaing an objec around a line parallel o one of he aes: Translae o a major ais, roae, ranslae back E.g. roae around a line parallel o -ais: ʹ T,, ) R ( ) T(,, ) ( p p p p ( p, p ) Translae Roae Translae back CENG 477 Compuer Graphics 8

Roaion Around an Arbirar Ais Sep : Translae he objec so ha he roaion ais passes hough he origin Sep : Roae he objec so ha he roaion ais is aligned wih one of he major aes Sep 3: Make he specified roaion Sep 4: Reverse he ais roaion Sep 5: Translae back CENG 477 Compuer Graphics 9

Roaion Around an Arbirar Ais CENG 477 Compuer Graphics 3

Roaion Around an Arbirar Ais Firs deermine he ais of roaion: v (,, ) u is he uni vecor along v: u v v ( a, b, c) CENG 477 Compuer Graphics 3

Roaion Around an Arbirar Ais Ne ranslae o origin: T CENG 477 Compuer Graphics 3

Roaion Around an Arbirar Ais Then align u wih one of he major ais (,, or ) This is a wo-sep process: Roae around o bring u ono plane (CCW) Roae around o align he resul wih he -ais (CW) u α β u We need cosine and sine of angles α and ß CENG 477 Compuer Graphics 33

Roaion Around an Arbirar Ais We need cosine and sine of angles α and ß: u u' u α u u u u + u + u u + u where u cos c b d d c + uʹ α d b ʹ u u sinα ) ( d c d b d b d c R α CENG 477 Compuer Graphics 34

Roaion Around an Arbirar Ais We need cosine and sine of angles α and ß: u cos c b a c b u u + + + + u β u u + β u sin c b a a u + + u β + + + + + + + + + + ) ( c b a c b c b a a c b a a c b a c b R β CENG 477 Compuer Graphics 35 Noe ha a & + b & + c & - +

Roaion Around an Arbirar Ais uing i all ogeher: ),, ( ) ( ) ( ) ( ) ( ) ( ),, ( ) ( T R R R R R T R α β β α This is he acual desired roaion. Oher erms are for alignmen and undoing he alignmen CENG 477 Compuer Graphics 36 - +

Alernaive Mehod Assume we wan o roae around he uni vecor u: We creae an orhonormal basis (ONB) uvw: u v w u ) To find v, se he smalles componen of u (in an absolue sense) o ero and swap he oher wo while negaing one: E.g. if u (a, b, c) wih c being he smalles absolue value hen v (-b, a, ) This corresponds o projecing he vecor o he neares major plane and roaing i 9 along he ais perpendicular o ha plane ) w u v 3) Normalie v and w Noe ha we are jus finding one of he infiniel man soluions CENG 477 Compuer Graphics 37

Alernaive Mehod Now roae uvw such ha i aligns wih : call his ransform M Roae around (u is now ) Undo he iniial roaion: call his M - Finding M - (roaing o uvw) is rivial: How o ransform [ ] T such ha i urns ino [u u u ] T Similar for he and ais M u u u v v v w w w Verif ha his mari ransforms o u, o v, and o w CENG 477 Compuer Graphics 38

Alernaive Mehod Finding M is also rivial as M - is an orhonormal mari (all rows and columns are orhogonal uni vecors) For such marices, inverse is equal o ranspose: CENG 477 Compuer Graphics 39 w w w v v v u u u M

Alernaive Mehod The final roaion ransform is: M,- R / ()M We assumed ha he origin of uvw is he same as he origin of Oherwise, we should accoun for his difference: T,- M,- R / ()MT Undo he ranslaion Translae he origin of uvw o CENG 477 Compuer Graphics 4

Scaling Change he coordinaes of he objec b scaling facors ' ' ' s s s ʹ ʹ S CENG 477 Compuer Graphics 4

Scaling w.r.. a Fied oin Translae o origin, scale, ranslae back Translae Scale Translae back T S T ʹ ),, ( ),, ( f f f f f f CENG 477 Compuer Graphics 4

Reflecion Reflecion over he major planes: How abou reflecion over an arbirar plane? CENG 477 Compuer Graphics 43

Transforming Normals When we ransform an objec, wha happens o is normals? Do he ge ransformed b he same mari or does i require a differen one? Scale b: n / / S 3 n 3/ / 3 CENG 477 Compuer Graphics 44

Transforming Normals Afer he ransformaion he normal is no longer perpendicular o he objec Also i is no a uni vecor anmore Scale b: n / / S 3 n 3/ / 3 CENG 477 Compuer Graphics 45

Transforming Normals Roaion and ranslaion has no problems Bu, since all ransformaions are combined ino a single mari M, we should consider he general case. n v b a We mus have n.(b-a) n.v and his relaionship should be preserved afer he ransformaion CENG 477 Compuer Graphics 46

Transforming Normals Tha is n.v and n'.v' where v' Mv and n' Zn Z is he mari we are looking for How o compue Z? n v b a CENG 477 Compuer Graphics 47

Transforming Normals n.v n T v n'.v' n' T v' n' T Mv n T Z T Mv If Z T M I (ideni) he relaionship will be preserved So Z (M - ) T Noe ha his is equal o (M T ) - as (M - ) T (M T ) - for a square (n b n) mari M n v b a CENG 477 Compuer Graphics 48

A Word on Noaion Unil now, we performed ransformaions b mulipling our poins from he righ: 9 9 9 a b c d e f g h i j k l Anoher noaion is o mulipl from he lef: 9 9 9 a b c d e f g h i j k l D Noe ha in his case everhing is ransposed CENG 477 Compuer Graphics 49

A Word on Terminolog Imagine a D roaion mari such as: Transforming an objec b his mari will no change is shape If we also add ranslaion: cos () sin () sin () cos () The shape will remain inac cos () sin () / sin () cos () M CENG 477 Compuer Graphics 5

A Word on Terminolog In general, an arbirar sequence of roaion and ranslaion marices will have he following form: r -- r -& / r &- r && M Such ransformaions are called rigid-bod ransformaions A shape ma be roaed and ranslaed b is form is no alered in an wa CENG 477 Compuer Graphics 5

A Word on Terminolog Imagine also adding scaling The mari will now look like: a b / c d M where a, b, c, d conain he effec of roaion and scaling combined Such ransformaions will no necessaril preserve lenghs and angles, bu parallel lines will remain parallel Original Roaion Roaion and scaling CENG 477 Compuer Graphics 5

A Word on Terminolog Such ransformaions are called affine ransformaions An arbirar sequence of roaion, ranslaion, scaling, and shearing will produce an affine ransformaion Noe ha we sill have some degrees of freedom lef in he las row of our mari: a b / c d M B using his we can creae projecive ransformaions in which parallel lines ma no longer be parallel CENG 477 Compuer Graphics 53