Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Chapter 9: Combining Transformation Operators.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Advertisements

2D Geometric Transformations
This terms course Last term we both worked on learning 2 things –Processing –The concepts of graphics etc. This term will focus more on the basic concepts.
1 3D Vector & Matrix Chapter 2. 2 Vector Definition: Vector is a line segment that has the direction. The length of the line segment is called the magnitude.
Technische Universität München Fakultät für Informatik Computer Graphics SS 2014 Transformations Rüdiger Westermann Lehrstuhl für Computer Graphik und.
Geometric Transformations
1 Computer Graphics Chapter 6 2D Transformations.
CMPE 466 COMPUTER GRAPHICS
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Elementary 3D Transformations - a "Graphics Engine" Transformation procedures Transformations of coordinate systems Translation Scaling Rotation.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Chapter 14: The Camera.
Chapter 10: Coordinate Systems Chapter 10.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Goals Give student some idea.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 12 Chapter 12: Making the Applications Interesting.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 7 Chapter 7: Graphical Primitives.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 3 Chapter 3: Simple Graphics Program.
Rotations and Translations. Representing a Point 3D A tri-dimensional point A is a reference coordinate system here.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 11 Chapter 11: Hierarchical Modeling.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 2 Chapter 2: GUI API.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Chapter 4: Working with Graphics APIs.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Chapter 8: Transformation Operators.
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
CAP4730: Computational Structures in Computer Graphics
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Whiteboardmaths.com © 2011 All rights reserved
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Lecture Notes: Computer Graphics.
Mathematics for Computer Graphics. Lecture Summary Matrices  Some fundamental operations Vectors  Some fundamental operations Geometric Primitives:
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
2D Geometric Transformations
Geometric Transformations
Computer Graphics, KKU. Lecture 51 Transformations Given two frames in an affine space of dimension n, we can find a ( n+1 ) x ( n +1) matrix that.
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
1 Computer Graphics Week9 -3D Geometric Transformation.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 5 Chapter 5: MVC Architecture.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Chapter 15: Working with the Camera.
Geometrical Transformations 2 Adapted from Fundamentals of Interactive Computer Graphics, Foley and van Dam, pp , by Geb Thomas.
Transformations Objective: to develop an understanding of the four transformations. Starter – if 24 x 72 = 2016, find the value of: 1)2.8 x 72 = 2)2.8.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
2 COEN Computer Graphics I Evening’s Goals n Discuss viewing and modeling transformations n Describe matrix stacks and their uses n Show basic geometric.
Geometric Transformations Hearn & Baker Chapter 5 Some slides are taken from Robert Thomsons notes.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
CS552: Computer Graphics Lecture 4: 2D Graphics. Recap 2D Graphics Coordinate systems 2D Transformations o Translation o Scaling o Rotation Combining.
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
1 By Dr. HANY ELSALAMONY.  We have seen how to create models in the 3D world. We discussed transforms in lecture 3, and we have used some transformations.
1. Gauss-Jordan Method for Inverses 1.  Step 1: Write down the matrix A, and on its right write an identity matrix of the same size.  Step 2: Perform.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
Computer Graphics Lecture 16 Fasih ur Rehman. Last Class Homogeneous transformations Types of Transformations – Linear Transformations – Affine Transformations.
Computer Graphic 2 D Transformation.
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Midterm Review Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Geometric Transformations
Geometric Transformations Hearn & Baker Chapter 5
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics 3D Transformations
The Unit Square Saturday, 22 September 2018.
Viewing Transformations
Hierarchical Modeling
Rigid Body Transformations
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
2D/3D Transformations User Interfaces.
Geometric Objects and Transformations (II)
Transformation Operators
Rigid Body Transformations
Translation in Homogeneous Coordinates
Presentation transcript:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Chapter 9: Combining Transformation Operators

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 This Chapter: we will learn How and Costs of combine operators Inverse Operators Pivoted Scale/Rotate Programming Support UWBGL

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Given vertex: Translate then Scale: If Then And Translate Then Scale

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Example:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Compact Representation Computation Efficiency Cost to concatenate Worthwhile if uses operator many times Concatenate:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 !Warning! Order of operation Recall … So, if Then, in general

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Example: Order of operation For: If and

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Reminder … Transforms V a Translation (T) followed by Scale (S) Vertex is to the left of the operators!! In our case (row vectors): the following is undefined!!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Inverse Transform: Undo

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 For example:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 To undo (inverse): If: Then Or: Inverse of:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Inverse of:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Inverse of concatenated operator Apply the inverse in reverse order! In general: Inverse is not unique E.g., R(θ), inverse can be R(-θ) or R(-θ+360), or R(- θ+270) …

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Combining Translation and Scaling Translate before scale to align vertex with origin “anchor” the vertex E.g., scale rectangle by S(3,0.5) with a fixed anchor (V c )

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Pivoted Scaling: Scaling with respect to Pivot position: E.g., scale rectangle with respect to pt=(1,5)

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Rotation with Arbitrary Pivot Pivot position: E.g., rotate rectangle with respect to top-right corner (pr) pt=(3,8)

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Tut 9.1: Simple Concatenation Label B + C: M a = S T Label D: loads M a to M W All vertex goes through V M W M V M P Rectangle transform by: V M a

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Tut 9.2: Order or concatenation GUI Check box controls m_bTranslateFirst Label B: M a =ST or M a =TS

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Matrix Stack: Push-down stack of matrices Graphics API support for concatenation of transform operators (matrices) Operations supported Push Pop Concatenation Translate/scale/rotate Load/Store

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Tut 9.3: Working with Matrix Stack Label C: Top of Stack <- ST Label D: Top of Stack <- TS Label E: M W <- Top of Stack

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Tut 9.4: Pivoted Scale/Rotate Implements:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Tut 9.4: … details … Label C computes:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Tut 9.5: Transform Primitives Label C1/C2: push/pop Label D: set up transform for Drawing rectangle 1 Label F: set up transform for Drawing rectangle 2

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Lib9: Drawing with MatrixStack DrawHelper: Defines the Stack behavior D3D_DrawHelper Defines D3D Matrix Stack

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Lib9: D3D_DrawHelper

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Lib9: XformInfo class Set/Get: Scale/Translate/Rotate Pivot SetupModelStack(): Calls DrawHelper’s AccumulateModelTransform()

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Tut 9.6: Using XformInfo Identical to 9.5 … using XformInfo

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Tut 9.7: XformInfoControl CXformInfoControls class (MFC Dialog) Replace onto main TutorialDlg With a placeholder

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Using CXformInfoControl CModel must support Label B: GetSelectedXform() SetSelectedXform() CXformInfoControl Access model’s selected xform From theApp->GetModel().Get/Set selectedXform()