Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
43 views
12 pages
05 2d Transform Annotated
Uploaded by
xliudt.ust.hk
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save 05-2d-transform-annotated For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
43 views
12 pages
05 2d Transform Annotated
Uploaded by
xliudt.ust.hk
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save 05-2d-transform-annotated For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 12
Search
Fullscreen
2D Transformations Reading Required: Hearn and Baker, Sections 5.1-5.4, 5.6, 61-63, 6.5 Optional: @ Foley et al., Chapter 5.1-5.5 @ David F. Rogers and J. Alan Adams, Mathematical Blements for Computer Graphics, Second edition, MeGraw-Hill New York, 1990, Chapter 22D drawing Think of a program like PowerPoint, Illustrator, MacDraw... # Interactively create a number of primitives, eg., polygons and circles. @ Indicate a front-to-back ordering. @ Scale, translate, and rotate objects, as well as group them together. © Scroll or zoom the “canvas” to look at different parts of the drawing, ¢ Generate an image and displays it on the screen. 2D drawing, cont’d What are some of the key ingredients needed to make this work? # Specification of the front-to-back ordering # A sequence of geometric transformations, some of them stored in hierarchies corresponding to groups of primitives # Definition of the “visible” portion of the canvas «A mapping from the visible portions of the canvas to pixels on the screen © Software or hardware that is able to “rasterize” the primitives, ie., draw the pixels corresponding to the primitives.2D geometry pipeline Let’s think about this in terms of a set of coordinate systems: 1 w ‘Model space yy 2 (Object space) Yo | seale, 0 " window World space (Object space) fw scale, translate Ve i Normalized device space o eee (Screen space) 10 | seale Image space (Window space) (Raster space) (Screen space) evice space) Clipping To avoid drawing primitives or parts of primitives that do not appear in the viewport, we perform “clipping” Clipping includes: # Removal of primitives wholly outside of the viewport (a.k.a., “culling”) ¢ Intersection of the viewport with primitives that straddle the viewport boundary. Clipping can happen: @ In world space ¢ In normalized device space In image spaceA simple OpenGL example Here’s an example of an OpenGL program that will draw a black square over a white background: makeADrawingWindow() ; gl0rtho(xwmin, xw_max, yw.min, ywmax, -1.0, 1.0); glViewport(xi_min, yi_min, width_i, height_i); giClearColor(1.0, 1.0, 1.0, 0.0); giClear (GL_COLOR_BUFFER_BIT) ; glColor3#(0.0, 0.0, 0.0); giBegin(GL_POLYGON) ; glVertex2f(0.0, 0.0); glVertex2£(1.0, 0.0); glVertex2f(1.0, 1.0); glVertex2#(0.0, 1.0); glEnd() ; glFlushQ); For the remainder of this lecture, we will focus on 2D geometric transformations. Representation We can represent a point p = (x,y) in the plane x y as a row vector [xy] ® as a column vectorRepresentation, cont. Two-dimensional transformations We can represent a 2-D transformation M Here's all you get with a 2 x 2 transformation by a matrix matrix M: aio 2) _[ab][« cd y ed|ly | So vw! = axt+by y = cx+dy We will develop some intimacy with the If p is a row vector, MT goes on the right: elements a,b, ¢,d. p= pT ac lev) =e |S We will use column vectors.Identity Scaling Suppose we choose a = d = 1, b=c=0: Suppose we set b= c= 0, but let @ and d take on any positive value: © Gives the “identity” matrix fe # Gives a “scaling” matrix 20 od ol Doesn't move the points at all © Provides differential scaling in x and y: vw = ax y = dy un 2Suppose we keep b = c = 0, but let @ and d go negative Examples: -10 -10 ol 0-1 Mivror reflec. Mirren cef-edion obest Po 45" dine best y-wis 18 Now let’s leave a = d = 1 and experiment with c.. The matrix 10 cl gives: ae) yf =crty Effect is called a “shestingEffect on unit square how a general 2 x 2 transformation M affects the unit square: 0110) _ OONa| = Ocet+dd 6 Effect on unit square, cont. Observe: ¢ Origin invariant under M ¢ -M can be determined just by knowing how the corners (1, 0) and (0,1) are mapped cand d give x- and y-scaling © band c give z- and y-shearing 16Rotation From our observations of the effect on the unit square, it should be easy to write cou a matrix for “rotation about the ori o Ging, cose) : «eon, #8) Limitations of the 2 x 2 matrix A2x 2 matrix allows @ Scaling @ Rotation © Reflection @ Shearing Q: What important operation does that leave out? TranslationHomogeneous coordinates Idea is to loft the problem up into 3-space, adding a third component to every point: t 2 ; ale) And then transform with a 3 x 3 matrix: 1 10m)/[a =|o1n|]y O01 1 . . Gives translation! 19 Rotation about arbitrary points Until now, we have only considered rotation about the origin. With homogeneous coordinates, you can specify rotations about any point q with a matrix: elo ff /@-s © ' 9-4 © 1 Fl [sec oO oo1 ~F ee y|loet oon 1. Translate q to origin 2. Rotate 3. Translate back to q Note: Transformation order is important! 20 & YeWindow-to-viewport transformation How do we transform from the window in world coordinates to the viewport in screen space? World space ‘Normalized device oes Tw - Ze 4) Trenslete BE the engin 2) seabing tralele ba Cov min, Yen) He [io = xen O 1 = Yeon 2 > 4 en w-{ %& 2 2 8 See KO os ° Soe . M; = 1 8 Meni ' [ No] Mathematics of affine transformations All of the transformations we've looked at so far are examples of “affine transformations.” Here are some useful properties of affine transformations: Lines map to lines © Parallel lines remain parallel © Midpoints map to midpoints (in fact, ratios are always preserved)Summary What to take away from this lec © All the underlined names and names in quotations. # How points and transformations are represented. What all the elements of a 2 x 2 transformation matrix do. What homogeneous coordinates are and how they work for affine transformations. « How to concatenate transformations. © The mai ical properties of affine trasnformations. 2a
You might also like
2D Transformations: CMPT 361 Introduction To Computer Graphics Torsten Möller
PDF
No ratings yet
2D Transformations: CMPT 361 Introduction To Computer Graphics Torsten Möller
30 pages
2D Transformations
PDF
No ratings yet
2D Transformations
49 pages
Geom2d PDF
PDF
No ratings yet
Geom2d PDF
13 pages
Geometric Transformation-2D Updated
PDF
No ratings yet
Geometric Transformation-2D Updated
57 pages
CGV Mod2 Shankar
PDF
No ratings yet
CGV Mod2 Shankar
88 pages
Rotate Graphics
PDF
No ratings yet
Rotate Graphics
46 pages
Transformations and Linear Algebra For Graphisc Programming
PDF
No ratings yet
Transformations and Linear Algebra For Graphisc Programming
27 pages
Catatan 2
PDF
No ratings yet
Catatan 2
3 pages
Coordinate Systems and Transformations: Topics
PDF
No ratings yet
Coordinate Systems and Transformations: Topics
19 pages
Lecture3 PDF
PDF
No ratings yet
Lecture3 PDF
19 pages
Lecture3 PDF
PDF
No ratings yet
Lecture3 PDF
19 pages
L7 2DTransformations
PDF
No ratings yet
L7 2DTransformations
24 pages
Unti 2
PDF
No ratings yet
Unti 2
31 pages
L 11 (2 D Transformations)
PDF
No ratings yet
L 11 (2 D Transformations)
40 pages
Ch4 Grap Ch4
PDF
No ratings yet
Ch4 Grap Ch4
60 pages
Lecture 4 Karanja On 2D Transformation 1
PDF
No ratings yet
Lecture 4 Karanja On 2D Transformation 1
41 pages
Unit 2 - Part 1
PDF
No ratings yet
Unit 2 - Part 1
74 pages
Computer Graphics: Lecture #6 2D Geometric Transformations
PDF
No ratings yet
Computer Graphics: Lecture #6 2D Geometric Transformations
81 pages
Cse167 04
PDF
No ratings yet
Cse167 04
32 pages
Unit 3 Transformation
PDF
No ratings yet
Unit 3 Transformation
39 pages
Unit 2
PDF
No ratings yet
Unit 2
28 pages
Computer Graphics Using Opengl, 3 Edition F. S. Hill, Jr. and S. Kelley
PDF
No ratings yet
Computer Graphics Using Opengl, 3 Edition F. S. Hill, Jr. and S. Kelley
53 pages
2 D Transformations
PDF
No ratings yet
2 D Transformations
41 pages
CG Lecture2&3
PDF
No ratings yet
CG Lecture2&3
89 pages
Part 3 - Transformation - Notes
PDF
No ratings yet
Part 3 - Transformation - Notes
5 pages
Last Time: - Compositing - Painterly Rendering - Intro To 3D Graphics - Homework 3 Due Oct 12 in Class
PDF
No ratings yet
Last Time: - Compositing - Painterly Rendering - Intro To 3D Graphics - Homework 3 Due Oct 12 in Class
29 pages
21cs63 CG Vtu
PDF
No ratings yet
21cs63 CG Vtu
40 pages
09+ +transformations
PDF
No ratings yet
09+ +transformations
61 pages
Computer Graphics2-Kp
PDF
No ratings yet
Computer Graphics2-Kp
166 pages
02 Transformations
PDF
No ratings yet
02 Transformations
52 pages
2D Transformation
PDF
100% (1)
2D Transformation
34 pages
Unit 5 Three Dimensional Transformations: Structure Page No
PDF
No ratings yet
Unit 5 Three Dimensional Transformations: Structure Page No
21 pages
CG Unit Iii
PDF
No ratings yet
CG Unit Iii
126 pages
@vtucode - in 21CS63 Module 2 Textbook 2021 Scheme
PDF
No ratings yet
@vtucode - in 21CS63 Module 2 Textbook 2021 Scheme
63 pages
2-D Transformations Why Do We Need Transformations?: - Glusphere Draws A Sphere of Radius
PDF
No ratings yet
2-D Transformations Why Do We Need Transformations?: - Glusphere Draws A Sphere of Radius
7 pages
2-D Trans
PDF
No ratings yet
2-D Trans
26 pages
Geometry Transformations: 1 MCA 401A - Computer Graphics, Dept of Computer SC, M U
PDF
No ratings yet
Geometry Transformations: 1 MCA 401A - Computer Graphics, Dept of Computer SC, M U
70 pages
Unit 3
PDF
No ratings yet
Unit 3
69 pages
5 Transformation I
PDF
No ratings yet
5 Transformation I
35 pages
CG Unit 2 Ashish
PDF
No ratings yet
CG Unit 2 Ashish
22 pages
Two-Dimensional Geometric Transformations
PDF
No ratings yet
Two-Dimensional Geometric Transformations
41 pages
Assignment 2: Transformation and Viewing: 1 Three-Dimensional Homogeneous Coordinates (15 PTS)
PDF
No ratings yet
Assignment 2: Transformation and Viewing: 1 Three-Dimensional Homogeneous Coordinates (15 PTS)
6 pages
Computer Graphics: 3 Miniterm, Nov-Dec 2004
PDF
100% (1)
Computer Graphics: 3 Miniterm, Nov-Dec 2004
32 pages
Unit 1 3transformations
PDF
No ratings yet
Unit 1 3transformations
42 pages
TRANSFORMATIONS
PDF
No ratings yet
TRANSFORMATIONS
44 pages
CH 5
PDF
No ratings yet
CH 5
23 pages
Cheat Sheet
PDF
No ratings yet
Cheat Sheet
3 pages
CG Unit 2
PDF
No ratings yet
CG Unit 2
17 pages
Lecture 6 Geometric Transformations
PDF
No ratings yet
Lecture 6 Geometric Transformations
36 pages
13 Combinetransforms
PDF
No ratings yet
13 Combinetransforms
15 pages
Homogeneous Coordinates
PDF
No ratings yet
Homogeneous Coordinates
14 pages
CS-378: Game Technology: Lecture #2: Transformations
PDF
No ratings yet
CS-378: Game Technology: Lecture #2: Transformations
79 pages
Transformation 1
PDF
No ratings yet
Transformation 1
34 pages
Computer Graphics Lecture 6-7
PDF
No ratings yet
Computer Graphics Lecture 6-7
74 pages
CG - Module - 2
PDF
No ratings yet
CG - Module - 2
36 pages
CS 6504-Computer Graphics
PDF
No ratings yet
CS 6504-Computer Graphics
54 pages
Mod 2
PDF
No ratings yet
Mod 2
55 pages