CS F-07 Objects in 2D 1
|
|
- Harry Rice
- 5 years ago
- Views:
Transcription
1 CS F-07 Objects in 2D : Representing Polgons We want to represent a simple polgon Triangle, rectangle, square, etc Assume for the moment our game onl uses these simple shapes No curves for the moment... How could we represent one of those polgons? 07-1: Representing Polgons We want to represent a simple polgon Triangle, rectangle, square, etc Assume for the moment our game onl uses these simple shapes No curves for the moment... How could we represent one of those polgons? List of points, starting with some arbitrar point, moving clockwise around the polgon 07-2: Representing Polgons (1,1), (1,-1), (-1,-1), (-1,1) 07-3: Representing Polgons How could we represent a simple circle? 07-4: Representing Polgons How could we represent a simple circle? Center position (Vector) Radius (scalar)
2 CS F-07 Objects in 2D : Modifing Polgons What if we wanted to modif a polgon Translation, rotation, scaling, etc Start with an eas one how can we translate (move) a polgon? 07-6: Translating Polgon To translate a polgon, all we need to do is translate each one of its points Move a polgon over 1 unit, up 0.5 units Add (1, 0.5) to each point Points are just translations from origin 07-7: Translating Polgon (1,1), (1,-1), (-1,-1), (-1,1) 07-8: Rotation -2 Translate over 1, up 0.5 Add (1,0.5) to each point in polgon (2,1.5), (2,-0.5), (0,-.5), (-0,1.5) Rotations are a bit trick Start with a simnplier case Rotate a point around the origin 07-9: Rotation Θ
3 CS F-07 Objects in 2D 3 Rotate the point (0,) counterclockwise around the origin b Θ degrees What is the new point? 07-10: Rotation l Θ sin Θ = l = l sin Θ cos Θ = l = l cos Θ Rotate the point (0,) counterclockwise around the origin b Θ degrees What is the new point? 07-11: Rotation Original point is at (, 1) distance from the origin l = New position = cosθ New postion = sin Θ Was eas beacuse the disance from the origin l was eas to calculate. What if original point was not on an ais? 07-12: Rotation Rotating a point not on an ais Use polar coordinates! r Θ 07-13: Rotation Using polar coordinates for rotation sounds kind of like cheating Of course it is eas to rotate in polar coordinates!
4 CS F-07 Objects in 2D 4 Translation is harder though... (Probabl) don t want to write all our game logic using polar coordinates Depends on the game... Transform into polar coordinates, do rotation, transform back. Hope everthing simplifies nicel! 07-14: Rotation Θ r Θ1 Rotate point at (r,θ1) Θ degrees counterclockwise New point (r, Q2) = (r, Θ1 + Θ) Θ : Rotation Conversion from Polar coordinates to Cartesian coordinates Given a point (r, Θ) in Polar coordinates, how can we create a point (, ) in Cartesian coordinates? 07-16: Polar Cartesian r Θ = r sin Θ = r cos Θ 07-17: Rotation Point p 1 at (r, Θ 1 ), rotate p 1 b Θ New point p 2 at (r, Θ 1 + Θ) In Cartesian coordinates: 07-18: Rotation Point p 1 at (r, Θ 1 ), rotate p 1 b Θ New point p 2 at (r, Θ 1 + Θ) In Cartesian coordinates:
5 CS F-07 Objects in 2D 5 = r cos(θ 1 + Θ) = r sin(θ 1 + Θ) How do we compute sin(θ 1 + Θ)? 07-19: sin(+) A sin(+) = O B C 07-20: sin(+) D E A sin(+) = (AB + BC) / OA O B C 07-21: cos(+) D E A sin(+) = (AB + BC) / OA = (AB + DE) / OA = AB / OA + DE / OA O B C 07-22: sin(+) D E O B A C 07-23: sin(+) D E sin(+) = (AB + BC) / OA = (AB + DE) / OA = AB / OA + DE / OA = (AB / OA) (AD / AD) + (DE / OA)(OD / OD)
6 CS F-07 Objects in 2D 6 O B A C 07-24: sin(+) D E sin(+) = (AB + BC) / OA = (AB + DE) / OA = AB / OA + DE / OA = (AB / OA) (AD / AD) + (DE / OA)(OD / OD) = (AB / AD) (AD / OA) + (DE / OD)(OD / OA) O B A C 07-25: cos(+) D E sin(+) = (AB + BC) / OA = (AB + DE) / OA = AB / OA + DE / OA = (AB / OA) (AD / AD) + (DE / OA)(OD / OD) = (AB / AD) (AD / OA) + (DE / OD)(OD / OA) = (cos )(sin ) + (sin )(cos ) A cos(+) = O B C 07-26: cos(+) D E A cos(+) = OC / OA O B C 07-27: cos(+) D E A cos(+) = OC / OA = (OE - CE) / OA O B C D E
7 CS F-07 Objects in 2D : cos(+) A cos(+) = OC / OA = (OE - CE) / OA = (OE - BD) / OA O B C 07-29: cos(+) D E O B A C 07-30: cos(+) D E cos(+) = OC / OA = (OE - CE) / OA = (OE - BD) / OA = OE / OA - BD / OA O B A C 07-31: cos(+) D E cos(+) = OC / OA = (OE - CE) / OA = (OE - BD) / OA = OE / OA - BD / OA = (OE/OA)(OD/OD) - (BD/OA)(AD/AD) = (OE/OD)(OD/OA) - (BD/AD)(AD/OA) O B A C D E 07-32: Back to Rotation! new = r cos(θ 1 + Θ) cos(+) = OC / OA = (OE - CE) / OA = (OE - BD) / OA = OE / OA - BD / OA = (OE/OA)(OD/OD) - (BD/OA)(AD/AD) = (OE/OD)(OD/OA) - (BD/AD)(AD/OA) = (cos )(cos ) - (sin )(sin ) new = r((cos Θ 1 )(cos Θ) (sin Θ 1 )(sin Θ)) 07-33: Back to Rotation! new = r cos(θ 1 + Θ) new = r((cos Θ 1 )(cos Θ) (sin Θ 1 )(sin Θ))
8 CS F-07 Objects in 2D 8 new = (r(cos Θ 1 ))cos Θ (r(sin Θ 1 ))sin Θ 07-34: Back to Rotation! new = r cos(θ 1 + Θ) new = r((cos Θ 1 )(cos Θ) (sin Θ 1 )(sin Θ)) new = (r(cos Θ 1 ))cos Θ (r(sin Θ 1 ))sin Θ new = cosθ sin Θ 07-35: Back to Rotation! new = r sin(θ 1 + Θ) new = r((cos Θ 1 )(sin Θ) + (sin Θ 1 )(cosθ)) 07-36: Back to Rotation! new = r sin(θ 1 + Θ) new = r((cos Θ 1 )(sin Θ) + (sin Θ 1 )(cosθ)) new = (r(cos Θ 1 ))sin Θ + (r(sin Θ 1 ))cosθ 07-37: Back to Rotation! new = r sin(θ 1 + Θ) new = r((cos Θ 1 )(sin Θ) + (sin Θ 1 )(cosθ)) new = (r(cos Θ 1 ))sin Θ + (r(sin Θ 1 ))cosθ new = sin Θ + cosθ 07-38: Back to Rotation! Given a point (, ), we can rotate it around the origin as follows: new = cosθ sin Θ new = sin Θ + cosθ We can do this with a matri multiplication 07-39: Back to Rotation! [, [ cosθ sin Θ sinθ cosθ = [cosθ sinθ, sin Θ + cosθ 07-40: Rotating Objects Polgon, consisting of a list of points Rotate the polgon b angle Θ around origin
9 CS F-07 Objects in 2D 9 Θ Θ 07-41: Rotating Objects Polgon, consisting of a list of points Rotate the polgon b angle Θ around origin Rotate each point individuall around the origin Done with a matri multiplication 07-42: Rotating Objects Original Polgon: p 0, p 1... p n New Polgon: p 0 M, p 1 M,...p n M [ cosθ sin Θ where M = sin Θ cosθ 07-43: Rotating Objects cos 45 sin 45 -sin 45 cos : Rotating Objects Θ cos 45 sin 45 -sin 45 cos : Rotating Objects
10 CS F-07 Objects in 2D 10 Θ cos 45 sin 45 -sin 45 cos 45 Θ 07-46: Rotating Objects How can we rotate an object around some point other than the origin? Θ Θ 07-47: Rotating Objects How can we rotate an object around some point other than the origin? Translate to the origin Rotate Translate back 07-48: Rotating Objects
11 CS F-07 Objects in 2D 11 Rotate π/4 around (1,0) Translate to origin, Rotate π/4 around (0,0), Translate back 07-49: Multiple Cooridinate Sstems World Space Camera (Screen) Space Inertial Space Object Space 07-50: World Space Define an origin for our world Could be in the middle of our world, in one corner, etc Define each object s position in the world as an offset from thhis point 07-51: Camera (screen) Space Position that object appears on the screen Not alwas the same as world space! Could have a much larger world, that screen scrolls across zoom in 07-52: Camera (screen) Space
12 CS F-07 Objects in 2D 12 World space Screen Space 07-53: Camera (screen) Space World Space Screen Space Position (20,50) in Screen Space Position (30, 75) in World Space 07-54: Camera (screen) Space You could calculate everthing in Camera space... Moving camera becomes difficult need to move all objects in the world along with the camrea Objects are moving on their own, need to combine movements Zooming in becomes problematic 07-55: Object Space New Coordinate sstem based on the object Origin is at the base (or center) of the objet Aes are nicel aligned 07-56: Intertial Space
13 CS F-07 Objects in 2D 13 Halfwa betwen object space and world space Aes parallel to world space Origin same as object space Object : Inertial Space + Object Space 07-58: Inertial Space World Space Object Space Inertial Space + + World Space 07-59: Inertial Space 07-60: Changing Coordinate Spaces Our character is wearing a red hat The hat is at position (0,100) in object space What is the position of the hat in world space? To make life easier, we will think about rotating the aes, instead of moving the objects
14 CS F-07 Objects in 2D Object Space : Changing Coordinate Spaces + World Space Rotate ais clockwise 45 degrees + + Object Space : Changing Coordinate Spaces World Space 07-63: Changing Coordinate
15 CS F-07 Objects in 2D Translate aes to the left & down Object Space (now Inertial Space) Spaces World Space 07-65: Changing Coordinate Spaces Rotate aes to the left 45 degrees : Changing Coordinate Spaces Object Space (now World Space) + World Space Hat rotates the the right 45 degrees, from (0,100) to (-70, 70) Translate aes to the left 150, and down 50 Hat rotates to the right 150 and up 50, to (80, 120) + (80,120) world space + (0,100) Object space + Object Space : Changing Coordinate Spaces Objects World Space 07-67: Composite More complicated object made of multiple elements Several polgons, circles Define in Object Space origin the center of the object
16 CS F-07 Objects in 2D 16 Pol1: (-30,30), (30,30), (30,20), (-30,20) Pol2: (-5,20), (5,20), (5,-20), (-5,-20) Pol3: (-30,-20), (30,-20), (30,-30), (-30,-30) 07-68: Composite Objects Rotated -45 degrees Translated b [150, : Composite Objects World Space 07-70: Composite Objects We store the rotation and translation of entire object When we want to know the points of an sub-object in world space Doing collision, for instance Rotate and then translate the points of the subobject 07-71: Composite Objects Want to know the position of the 4 points of the blue rectangle in world space Local space positions are p 1, p 2, p 3, p 4 World space postions are: 07-72: Composite Objects Want to know the position of the 4 points of the blue rectangle in world space Local space positions are p 1, p 2, p 3, p 4
17 CS F-07 Objects in 2D 17 World space postions are: [ cos( 45) sin( 45) new p 1 = p 1 sin( 45) cos( 45) [ cos( 45) sin( 45) new p 2 = p 2 sin( 45) cos( 45) [ cos( 45) sin( 45) new p 3 = p 3 sin( 45) cos( 45)... etc + [150, [150, [150, : Other Transformations Transform with: : Other Transformations Transform with: : Other Transformations Transform with: : Other Transformations Transform with:
18 CS F-07 Objects in 2D : Uniform Scaling A matri of the form: [ k 0 0 k will uniforml scale an object. What happens if k = 1? k > 1? 0 < k < 1? 07-78: Nonuniform Scaling A matri can also be used to scale in different amounts on different aes. Object will be stretched / distorted 07-79: Nonuniform Scaling Transform with: : Nonuniform Scaling Transform with: : Nonuniform Scaling Transform with: : Nonuniform Scaling
19 CS F-07 Objects in 2D 19 Transform with: : Combining Transforms What would happen to a point that was transformed twice? 07-84: Combining Transforms [ [ cosθ1 sinθ [, 1 cosθ2 sin Θ 2 sinθ 1 cosθ 1 sinθ 2 cosθ 2 What would happen to a point that was transformed twice? 07-85: Combining Transforms ( [ ) [ cosθ1 sin Θ [, 1 cosθ2 sinθ 1 cosθ 1 sinθ 2 sin Θ 2 = cosθ 2 ([ [ cosθ1 sinθ [, 1 cosθ2 sinθ 1 cosθ 1 sinθ 2 ) sin Θ 2 cosθ 2 [ [ cos Θ1 sin Θ 1 cos Θ2 sin Θ 2 sin Θ 1 cos Θ 1 sin Θ 2 cos Θ 2 [ cos Θ1 cos Θ 2 sin Θ 1 sin Θ 2 cos Θ 1 sin Θ2 + sin Θ 1 cos Θ 2 sin Θ 1 cosθ 2 cosθ 1 sin Θ 2 sin Θ 1 sin Θ2 + cosθ 1 cos Θ 2 = = 07-86: Combining Transforms [ [ cos Θ1 sin Θ 1 cos Θ2 sin Θ 2 sin Θ 1 cos Θ 1 sin Θ 2 cos Θ 2 [ cos Θ1 cos Θ 2 sin Θ 1 sin Θ 2 cos Θ 1 sin Θ2 + sin Θ 1 cos Θ 2 sin Θ 1 cosθ 2 cosθ 1 sin Θ 2 sin Θ 1 sin Θ2 + cosθ 1 cos Θ 2 [ cos(θ1 + Θ 2) sin(θ 1 + Θ 2) sin(θ 1 + Θ 2) cos(θ 1 + Θ 2) = = 07-87: Combining Transforms We can also combine scaling and rotating [, [ cosθ sin Θ sinθ cosθ [ k 0 0 k With uniform scaling, we get the same result if we scale, then rotate as if we rotated, and then scaled.
20 CS F-07 Objects in 2D : Combining Transforms [ cosθ sin Θ sinθ cosθ [ k 0 0 k = = [ [ cosθ sin Θ k 0 sinθ cosθ 0 k [ k cosθ k sinθ k sin Θ k cosθ 07-89: Combining Transforms Transform with: cos 45 sin 45 -sin 45 cos 45 Transform with: cos 45 sin 45 -sin 45 cos : Non-Uniform Scale, Rotate cos 45 sin 45 -sin 45 cos : Non-Uniform Scale, Rotate cos 45 sin 45 -sin 45 cos : Non-Uniform Scale, Rotate
21 CS F-07 Objects in 2D 21 cos 45 sin 45 -sin 45 cos : Non-Uniform Scale, Rotate cos 45 sin 45 -sin 45 cos : Other Transformations How would the following matri transform an object? 07-95: Reflection [ : Reflection : Reflection Reflecting an object twice around the same ais brings and object back to its original state Reflecting around the -ais and then reflecting around the -ais is the same as...
22 CS F-07 Objects in 2D : Reflection 07-99: Reflection How could we reflect an object around its own center line, instead of around the - or - ais? : Reflection How could we reflect an object around its own center line, instead of around the - or - ais? Translate and rotate the object so that its own center line is the same as the - or - ais Reflect Translate, rotate back If the centerline of an object is either the - or - ais in object space, this is easier : Shearing How would the following matri transform an object? : Shearing [ : Shearing
23 CS F-07 Objects in 2D : Shearing Shearing an object is the same as: Rotating the object Non-uniform scale Rotating back (not b the same angle) Rotate clockwise 45 Non-uniform scale (strech, shrink ) Rotate counterclockwise (~32) : Shearing : Linear Transforms Matri operations represent linear transformation of objects Number of points in in a line before the transformation, still be in a line after the transformation Line ma be stretched and rotated, still be a line : Linear Transforms This gives us a hand wa of seeing how a matri will transform an object See how the matri will transform the aes [1,0, [0,1 Object will be transformed in the same wa
24 CS F-07 Objects in 2D 24 How will this transform an object : Linear Transforms How will this transform an object ais ais : Linear Transforms How will this transform an object ais ais : Linear Transforms
25 CS F-07 Objects in 2D 25 How will this transform an object : Linear Transforms How will this transform an object 2 2 -ais ais : Linear Transforms How will this transform an object : Linear Transforms 0.1 1
26 CS F-07 Objects in 2D 26 How will this transform an object ais ais : Linear Transforms : Determinant Determinant of 22 matri: a b c d = ad cb p1 p2 p1 p2 = Area of Parallelogram p 2 p + p p : Determinant p 1 p 1
27 CS F-07 Objects in 2D 27 p1 p2 p1 p2 = - (Area of Parallelogram) p 1 p + p p : Determinant : Determinant Signed area of parallelogram p 2 p 2 If transformation includes a reflection, then : Determinant Signed area of parallelogram If transformation includes a reflection, then : Determinant Determinant is negative Signed area of parallelogram If is a pure rotation (no scale, no shear, no rotation) : Determinant Signed area of parallelogram If is a pure rotation (no scale, no shear, no rotation) : Translation Determinant = 1 (Other direction is not alwas true..) We can implement rotation / scale / reflection / shearing using matri operations What about translation? : Translation Can t translate an object using a 22 matri
28 CS F-07 Objects in 2D 28 Consider a point at the origin How will a point a the origin be modified b a matri? : Translation Can t translate an object using a 22 matri Consider a point at the origin How will a point a the origin be modified b a matri? Not changed b an matri! : Translation Matrices can onl do linear transformations Translation is not a linear transformation Can t use matrices to do translation... Unless we cheat a little! : Translation We can use matrices to do translation as long as we use something different than 22 matrices Add a dumm value to the end of all points (alwas 1) Add a new row / column to matri : Translation : Translation : Translation Adding rotation [,, 1 [,, 1 [,, δ δ δ δ 1 = [,, 1 = = [ + δ, + δ, : Translation [,, 1 [,, 1 [ a b [, c d a b 0 c d a b 0 c d 0 δ δ 1 = [a + c, b + d = [a + c, b + d, 1 = [a + c + δ, b + d + δ, 1
29 CS F-07 Objects in 2D 29 So, we can use a matri to do both rotation and translation : Translation cosθ sin Θ 0 sinθ cosθ 0 δ δ 1 First, rotate counter-clockwise b Θ Then translate b [δ, δ : Combining Transforms Let s look at an eample First rotate b π/2 (90 degrees) counterclockwise Then translate b +1 Rotate π/2 Translate : Combining Transforms [ cos Θ sin Θ 0 sin Θ cos Θ : Combining Transforms Another eample First translate b +1 [ Then rotate b π/2 (90 degrees) counterclockwise = [ cos Θ sin Θ 0 sin Θ cos Θ = [ Translate +1 Rotate π/ : Combining Transforms [ [ cos Θ sinθ 0 sin Θ cos Θ = [ cos Θ sin Θ 0 sin Θ cos Θ 0 cos Θ sin Θ 1 = [ Same as rotating, and then moving up +
30 CS F-07 Objects in 2D : Combining Transforms Rotate π/4 Translate +1 Translate +1 Rotate π/ : Combining Transforms Rotating b π/4, then translating 1 unit + [ cos Θ sin Θ 0 sin Θ cos Θ : Combining Transforms [ Translating 1 unit +, then rotating b π/4 [ [ cos Θ sin Θ 0 sin Θ cos Θ = = [ cos Θ sin Θ 0 sin Θ cos Θ [ cos Θ sin Θ 0 sin Θ cos Θ 0 cos Θ sin Θ 1 = = [ 1/ 2 1/ 2 0 1/ 2 1/ [ 1/ 2 1/ 2 0 1/ 2 1/ 2 0 1/ 2 1/ 2 1 Same as rotating π/4 counterclockwise, and then translating over (+) 1/ 2 and up (+) 1/ : Non-Standard Aes We want to rotate around an ais that does not go through the origin Rotate around point at 1,0 Create the approprate 33 vector : Non-Standard Aes
31 CS F-07 Objects in 2D 31 Rotate π/4 around (1,0) : Non-Standard Aes First, translate to the origin Then, do the rotation Finall, translate back : Non-Standard Aes First, translate to the origin Then, do the rotation Finall, translate back : Non-Standard Aes First, translate to the origin Then, do the rotation cosθ sin Θ 0 sinθ cosθ = 1/ 2 1/ 2 0 1/ 2 1/ Finall, translate back : Non-Standard Aes First, translate to the origin Then, do the rotation
32 CS F-07 Objects in 2D 32 Finall, translate back : Non-Standard Aes Final matri: : Non-Standard Aes / 2 1/ 2 0 1/ 2 1/ / 2 1/ 2 0 1/ 2 1/ 2 0 1/ 2 1/ 2 1 1/ 2 1/ 2 0 1/ 2 1/ / 2 1/ 2 1 Rotate π/4 around (1,0) Translate to origin, Rotate π/4 around (0,0), Translate back : Non-Standard Aes
33 CS F-07 Objects in 2D 33 Rotate π/4 around (1,0) Rotate p/4 around (0,0), then translate over 1-1 / 2 and down 1/ : Non-Standard Aes Note that the rotation component (upper left 22 matri) is the same as if we were rotating around the origin Onl the position component is altered. In general, whenever we do a rotation and a number of translations, the rotation component will be unchanged : Linear Transforms? Matricies can onl do linear transformations Translation is not a linear transform... but we are using matrices to do translation What s up? : Homogeneous Space We are no longer working in 2D, we are now working in 3D Etra 3rd parameter, that is alwas == 1 We can etend our definition to allow the 3rd parameter to be some value other than 1 Need to be able to convert back to 2D space : 3D Homogeneous Space To convert a point (,, w) in 3D Homogeneous space into 2D (, ) space: Place a plane at w = 1 (,, w) maps to the (, ) position on the plane where the ra (,, w) intersects the plane
34 CS F-07 Objects in 2D 34 w (,,w) w= : 3D Homogeneous Space w (,,w) (/w,/w) w= : 3D Homogeneous Space : 3D Homogeneous Space Converting from a point in 3D homogeneous space to 2D space is eas Divide the and coordinates b w What happens when w = 0? : 3D Homogeneous Space Converting from a point in 3D homogeneous space to 2D space is eas Divide the and coordinates b w What happens when w = 0? Point at infinit
35 CS F-07 Objects in 2D 35 Direction, but not a magnitude : 3D Homogeneous Space For a given (,, w) point in 3D Homogeneous space, there is a single corresponding point in standard 2D space Though when w = 0, we are in a bit of a special case For a single point in standard 2D space, there are an infinite number of corresponding points in 3D Homogeneous space : Translation We are still doing a linear trasformation of the 3D vector We are shearing the 3D space The resulting projection back to 2D is seen as a translation : Translation 2D Shape Transform to 3D Homogenous Space w Shear operation in 3D space w Back to 2D : Inverse Finding inverse of 22 matri : Inverse [ a b A = c d A 1 = 1 [ d b deta c a A matri is signular if it does not have an inverse determinant = 0
36 CS F-07 Objects in 2D 36 Wh does this make sense, geometricall? : Orthogonal Matrices A matri M is orthogonal if: MM T = I M T = M 1 Orthogonal matrices are hand, because the are eas to invert Is there a geometric interpretation of orthogonalit? : Orthogonal Matrices Do all the multiplications : Orthogonal Matrices MM T = I [ [ m11 m 12 m11 m 21 m 21 m 22 m 12 m 22 = [ m 11 m 11 + m 12 m 12 = 1 m 11 m 21 + m 12 m 22 = 0 m 21 m 11 + m 22 m 12 = 0 m 21 m 21 + m 22 m 22 = 1 Hmmm... that doesn t seem to help much : Orthogonal Matrices Recall that rows of matri are basis after rotation v = [m 11, m 12 v = [m 21, m 22 Let s rewrite the previous equations in terms of v and v : Orthogonal Matrices m 11 m 11 + m 12 m 12 = 1 v v = 1 m 11 m 21 + m 12 m 22 = 0 v v = 0 m 21 m 11 + m 22 m 12 = 0 v v = 0 m 21 m 21 + m 22 m 22 = 1 v v = : Orthogonal Matrices What does it mean if u v = 0?
37 CS F-07 Objects in 2D 37 (assuming both u and v are non-zero) What does it mean if v v = 1? : Orthogonal Matrices What does it mean if u v = 0? (assuming both u and v are non-zero) u and v are perpendicular to each other (orthogonal) What does it mean if v v = 1? v = 1 So, transformed basis vectors must be mutuall perpendicular unit vectors : Orthogonal Matrices If a transformation matri is orthogonal, Transformed basis vectors are mutuall perpendicular unit vectors What kind of transformations are done b orthogonal matrices? : Orthogonal Matrices If a transformation matri is orthogonal, Transformed basis vectors are mutuall perpendicular unit vectors What kind of transformations are done b orthogonal matrices? Rotations & Reflections : Orthogonal Matrices Sanit check: Rotational matrices are orthoginal: [ a b A = c d, A 1 = 1 det A [ d b c a [ cosθ sinθ A = sinθ cosθ, A 1 = = [ cosθ sinθ sinθ cosθ [ cos( Θ) sin( Θ) sin( Θ) cos( Θ) : Eamples An object s position has a rotational matri M and a position p. A point o 1 = [o 1, o 1 is in object space for the object, What is the position of the point in world space?
38 CS F-07 Objects in 2D : Eamples An object s position has a rotational matri M and a position p. A point o 1 = [o 1, o 1 is in object space for the object, What is the position of the point in world space? Position in world space: o 1 M + p : Eamples An object s position has a rotational matri M and a position p. A point w 1 = [w 1, w 1 is in world space. What is the position of the point in objet space : Eamples An object s position has a rotational matri M and a position p. A point w 1 = [w 1, w 1 is in world space. What is the position of the point in objet space
39 CS F-07 Objects in 2D 39 Position in object space: (w 1 p)m T : Eamples Origin of screen is at position [c, c in world space Object is a point [p, p in world space World has + to right, + up Screen has + to right, + down What is the position of p in screen space? : Eamples [c, c +Y + [p, p : Eamples
40 CS F-07 Objects in 2D 40 [c, c +Y + [p, p + [ 1 0 [p, p [c, c : Eamples [c, c + +Y + [p, p + + [p c, c p : Eamples Coversion from + up to + down Points and rectangles eas to convert Sprites would require a reflection Can use SpriteEffects to reflect sprites Best to sta in reflected space : Objects with Sprites
41 CS F-07 Objects in 2D : Objects with Sprites +X : Objects with Sprites
42 CS F-07 Objects in 2D 42 Sprite SpriteHalfHeight Center of the sprite is at [SpriteHalfWidth,SpriteHalfHeight from top left corner of sprite : Objects with Sprites Boundar bo locations are stored as edge points of each rectangle (4 points per) +X : Objects with Sprites Θ Object is located at position [, and has rotation Θ clockwise (since + is right, + is down) +
43 CS F-07 Objects in 2D : Objects with Sprites When dealing with the object in game logic (collistions, etc), we need to know the positions of each of the points of each rectangle in world space. If a verte has position p in local (object) space, what is its position in world space? : Objects with Sprites When dealing with the object in game logic (collistions, etc), we need to know the positions of each of the points of each rectangle in world space. If a verte has position p in local (object) space, what is its position in world space? [ cosθ sinθ p + [, sinθ cosθ : Objects with Sprites To draw the sprite on the screen: SpriteBatch sb Vector2 pos = new Vector2(,); Vector2 center = new Vector2(SpriteHalfWidh, SpriteHalfHeihgt); sb.draw(teture, pos, null, Color.White, theta, center, 1.0f, SpriteEffects.None, 0.0f); : Eamples Object1 has rotational matri M 1 and position p 1 Object2 has rotational matri M 2 and position p 2 Point q 1 is at postion [q 1, q 1 in the object space of Object1 Point q 2 is at positio [q 2, q 2 in the object space of Object 2 What is the vector from q 1 to q 2 in the object space of q 1? +Y q1 q1 q2 q2 [p1, p1 [p2, p : Eamples +
44 CS F-07 Objects in 2D 44 +Y q1 q1 q2 q2 [p1, p1 [p2, p : Eamples : Eamples + First, find the position of point q 2 in the local space of Object1. What s the best wa to do this? : Eamples First, find the position of point q 2 in the local space of Object1. What s the best wa to do this? Go through the world space Find the position of q 2 in world space, translate to object space : Eamples Position of q 2 in world space: q 2 M 2 + p 2 Position of q 2 in Object1 s local space (q 2 (global) p 1 )M1 T = (q 2M 2 + p 2 p 1 )M1 T Vector from q 1 to q 2 in local space of Object 1: : Eamples Position of q 2 in world space: q 2 M 2 + p 2 Position of q 2 in Object1 s local space (q 2 (global) p 1 )M1 T = (q 2M 2 + p 2 p 1 )M1 T Vector from q 1 to q 2 in local space of Object 1: (q 2 M 2 + p 2 p 1 )M1 T q 1
45 CS F-07 Objects in 2D : Eamples Given a transformation matri [ a b c d How can we determine if this is a pure rotation no scale, shear, reflection : Eamples Matri is pure rotation if: [ a b c d a = d -c = b sin(arccos(a)) = b What if we don t have access to arccos, sin? : Eamples Matri is pure rotation if: [ a b c d ac + bd = 0 [a,b and [c,d are perpendicular a*a + b*b = 1 [a,b is unit vector c*c + d*d = 1 [c,d is unit vector a*d - c*b = 1 No reflection : Eamples Spaceship, in local space looks down ais Position [p, p [ a b Orientation: c d Place an enem 10 units directl in front of spaceship, pointing straight back at it What is position and orientation of the new spaceship? : Eamples Spaceship, in local space looks down ais Position [p, p
46 CS F-07 Objects in 2D 46 [ a b Orientation: c d Place an enem 10 units directl in front of spaceship, pointing straight back at it What is position and orientation of the new spaceship? Position = [p, p + 10 [a, b [ a b Orientation: c d : Eamples
Game Engineering: 2D
Game Engineering: 2D CS420-2010F-07 Objects in 2D David Galles Department of Computer Science University of San Francisco 07-0: Representing Polygons We want to represent a simple polygon Triangle, rectangle,
More informationComputer Graphics. Geometric Transformations
Contents coordinate sstems scalar values, points, vectors, matrices right-handed and left-handed coordinate sstems mathematical foundations transformations mathematical descriptions of geometric changes,
More informationComputer Graphics. Geometric Transformations
Computer Graphics Geometric Transformations Contents coordinate sstems scalar values, points, vectors, matrices right-handed and left-handed coordinate sstems mathematical foundations transformations mathematical
More informationToday s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1
Toda s class Geometric objects and transformations Wednesda, November 7, 27 Computer Graphics - Class 5 Vector operations Review of vector operations needed for working in computer graphics adding two
More informationWhat and Why Transformations?
2D transformations What and Wh Transformations? What? : The geometrical changes of an object from a current state to modified state. Changing an object s position (translation), orientation (rotation)
More informationEditing and Transformation
Lecture 5 Editing and Transformation Modeling Model can be produced b the combination of entities that have been edited. D: circle, arc, line, ellipse 3D: primitive bodies, etrusion and revolved of a profile
More informationTwo Dimensional Viewing
Two Dimensional Viewing Dr. S.M. Malaek Assistant: M. Younesi Two Dimensional Viewing Basic Interactive Programming Basic Interactive Programming User controls contents, structure, and appearance of objects
More informationDouble Integrals in Polar Coordinates
Double Integrals in Polar Coordinates. A flat plate is in the shape of the region in the first quadrant ling between the circles + and +. The densit of the plate at point, is + kilograms per square meter
More information4. Two Dimensional Transformations
4. Two Dimensional Transformations CS362 Introduction to Computer Graphics Helena Wong, 2 In man applications, changes in orientations, sizes, and shapes are accomplished with geometric transformations
More informationHomogeneous Coordinates
COMS W4172 3D Math 2 Steven Feiner Department of Computer Science Columbia Universit New York, NY 127 www.cs.columbia.edu/graphics/courses/csw4172 Februar 1, 218 1 Homogeneous Coordinates w X W Y X W Y
More informationCS770/870 Spring 2017 Transformations
CS770/870 Spring 2017 Transformations Coordinate sstems 2D Transformations Homogeneous coordinates Matrices, vectors, points Coordinate Sstems Coordinate sstems used in graphics Screen coordinates: the
More informationDetermining the 2d transformation that brings one image into alignment (registers it) with another. And
Last two lectures: Representing an image as a weighted combination of other images. Toda: A different kind of coordinate sstem change. Solving the biggest problem in using eigenfaces? Toda Recognition
More informationGame Engineering CS S-05 Linear Transforms
Game Engineering CS420-2016S-05 Linear Transforms David Galles Department of Computer Science University of San Francisco 05-0: Matrices as Transforms Recall that Matrices are transforms Transform vectors
More informationCS559: Computer Graphics
CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 28 Most Slides from Stephen Chenne Finish Color space Toda 3D Transforms and Coordinate sstem Reading: Shirle ch 6 RGB and HSV Green(,,)
More informationImage Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz
Image Warping http://www.jeffre-martin.com Some slides from Steve Seitz 5-463: Computational Photograph Aleei Efros, CMU, Fall 2 Image Transformations image filtering: change range of image g() T(f())
More informationScene Graphs & Modeling Transformations COS 426
Scene Graphs & Modeling Transformations COS 426 3D Object Representations Points Range image Point cloud Surfaces Polgonal mesh Subdivision Parametric Implicit Solids Voels BSP tree CSG Sweep High-level
More information1. We ll look at: Types of geometrical transformation. Vector and matrix representations
Tob Howard COMP272 Computer Graphics and Image Processing 3: Transformations Tob.Howard@manchester.ac.uk Introduction We ll look at: Tpes of geometrical transformation Vector and matri representations
More informationImage Warping. Some slides from Steve Seitz
Image Warping http://www.jeffre-martin.com Some slides from Steve Seitz 5-463: Computational Photograph Aleei Efros, CMU, Fall 26 Image Warping image filtering: change range of image g() T(f()) f T f image
More informationCT5510: Computer Graphics. Transformation BOCHANG MOON
CT5510: Computer Graphics Transformation BOCHANG MOON 2D Translation Transformations such as rotation and scale can be represented using a matrix M.., How about translation? No way to express this using
More informationTo graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6
Polar Coordinates Any point in the plane can be described by the Cartesian coordinates (x, y), where x and y are measured along the corresponding axes. However, this is not the only way to represent points
More informationGame Engineering CS S-07 Homogenous Space and 4x4 Matrices
Game Engineering CS420-2014S-07 Homogenous Space and 4x4 Matrices David Galles Department of Computer Science University of San Francisco 07-0: Matrices and Translations Matrices are great for rotations,
More informationTo graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below:
Polar Coordinates Any point in the plane can be described by the Cartesian coordinates (x, y), where x and y are measured along the corresponding axes. However, this is not the only way to represent points
More information3D Geometry and Camera Calibration
3D Geometr and Camera Calibration 3D Coordinate Sstems Right-handed vs. left-handed 2D Coordinate Sstems ais up vs. ais down Origin at center vs. corner Will often write (u, v) for image coordinates v
More informationCSE528 Computer Graphics: Theory, Algorithms, and Applications
CSE528 Computer Graphics: Theor, Algorithms, and Applications Hong Qin State Universit of New York at Ston Brook (Ston Brook Universit) Ston Brook, New York 794--44 Tel: (63)632-845; Fa: (63)632-8334 qin@cs.sunsb.edu
More information8.6 Three-Dimensional Cartesian Coordinate System
SECTION 8.6 Three-Dimensional Cartesian Coordinate Sstem 69 What ou ll learn about Three-Dimensional Cartesian Coordinates Distance and Midpoint Formulas Equation of a Sphere Planes and Other Surfaces
More informationImage Metamorphosis By Affine Transformations
Image Metamorphosis B Affine Transformations Tim Mers and Peter Spiegel December 16, 2005 Abstract Among the man was to manipulate an image is a technique known as morphing. Image morphing is a special
More informationComputer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University
Computer Graphics P4 Transformations Aleksandra Pizurica Ghent Universit Telecommunications and Information Processing Image Processing and Interpretation Group Transformations in computer graphics Goal:
More informationPlot and connect the points in a coordinate plane to make a polygon. Name the polygon.
. Start Thinking Find at least two objects in each of the following categories: circle, square, triangle, and rectangle (nonsquare). Use a table to compare each object of the same categor in the following
More information[ ] [ ] Orthogonal Transformation of Cartesian Coordinates in 2D & 3D. φ = cos 1 1/ φ = tan 1 [ 2 /1]
Orthogonal Transformation of Cartesian Coordinates in 2D & 3D A vector is specified b its coordinates, so it is defined relative to a reference frame. The same vector will have different coordinates in
More informationIsometry: When the preimage and image are congruent. It is a motion that preserves the size and shape of the image as it is transformed.
Chapter Notes Notes #36: Translations and Smmetr (Sections.1,.) Transformation: A transformation of a geometric figure is a change in its position, shape or size. Preimage: The original figure. Image:
More informationUNIT 2 2D TRANSFORMATIONS
UNIT 2 2D TRANSFORMATIONS Introduction With the procedures for displaying output primitives and their attributes, we can create variety of pictures and graphs. In many applications, there is also a need
More informationCALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES
CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES YINGYING REN Abstract. In this paper, the applications of homogeneous coordinates are discussed to obtain an efficient model
More informationTransformations. Examples of transformations: shear. scaling
Transformations Eamples of transformations: translation rotation scaling shear Transformations More eamples: reflection with respect to the y-ais reflection with respect to the origin Transformations Linear
More informationGraphics and Interaction Transformation geometry and homogeneous coordinates
433-324 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation
More informationCOMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates
COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation
More information2D and 3D Transformations AUI Course Denbigh Starkey
2D and 3D Transformations AUI Course Denbigh Starkey. Introduction 2 2. 2D transformations using Cartesian coordinates 3 2. Translation 3 2.2 Rotation 4 2.3 Scaling 6 3. Introduction to homogeneous coordinates
More informationCS 548: COMPUTER GRAPHICS REVIEW: OVERVIEW OF POLYGONS SPRING 2015 DR. MICHAEL J. REALE
CS 548: COMPUTER GRPHICS REVIEW: OVERVIEW OF POLYGONS SPRING 05 DR. MICHEL J. RELE NOTE: COUNTERCLOCKWISE ORDER ssuming: Right-handed sstem Vertices in counterclockwise order looking at front of polgon
More informationCSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications
CSE328 Fundamentals of Computer Graphics: Theor, Algorithms, and Applications Hong in State Universit of New York at Ston Brook (Ston Brook Universit) Ston Brook, New York 794-44 Tel: (63)632-845; Fa:
More informationPARAMETRIC EQUATIONS AND POLAR COORDINATES
10 PARAMETRIC EQUATIONS AND POLAR COORDINATES PARAMETRIC EQUATIONS & POLAR COORDINATES A coordinate system represents a point in the plane by an ordered pair of numbers called coordinates. PARAMETRIC EQUATIONS
More informationPolar Coordinates
Polar Coordinates 7-7-2 Polar coordinates are an alternative to rectangular coordinates for referring to points in the plane. A point in the plane has polar coordinates r,θ). r is roughly) the distance
More information2D/3D Geometric Transformations and Scene Graphs
2D/3D Geometric Transformations and Scene Graphs Week 4 Acknowledgement: The course slides are adapted from the slides prepared by Steve Marschner of Cornell University 1 A little quick math background
More informationMore on Transformations. COS 426, Spring 2019 Princeton University
More on Transformations COS 426, Spring 2019 Princeton Universit Agenda Grab-bag of topics related to transformations: General rotations! Euler angles! Rodrigues s rotation formula Maintaining camera transformations!
More informationModeling Transformations
Modeling Transformations Michael Kazhdan (601.457/657) HB Ch. 5 FvDFH Ch. 5 Overview Ra-Tracing so far Modeling transformations Ra Tracing Image RaTrace(Camera camera, Scene scene, int width, int heigh,
More informationImage Warping. Some slides from Steve Seitz
Image Warping http://www.jeffre-martin.com Some slides from Steve Seitz 5-463: Computational Photograph Aleei Efros, CMU, Spring 2 Image Transformations image filtering: change range of image g() = T(f())
More informationInteractive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is.
Interactive Computer Graphics Warping and morphing Lecture 14+15: Warping and Morphing Lecture 14: Warping and Morphing: Slide 1 Lecture 14: Warping and Morphing: Slide 2 Warping and Morphing What is Warping
More informationMatrix Representations
CONDENSED LESSON 6. Matri Representations In this lesson, ou Represent closed sstems with transition diagrams and transition matrices Use matrices to organize information Sandra works at a da-care center.
More informationturn counterclockwise from the positive x-axis. However, we could equally well get to this point by a 3 4 turn clockwise, giving (r, θ) = (1, 3π 2
Math 133 Polar Coordinates Stewart 10.3/I,II Points in polar coordinates. The first and greatest achievement of modern mathematics was Descartes description of geometric objects b numbers, using a sstem
More information3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11
3D graphics rendering pipeline (1) Geometr Rasteriation 3D Coordinates & Transformations Prof. Aaron Lanterman (Based on slides b Prof. Hsien-Hsin Sean Lee) School of Electrical and Computer Engineering
More information3-Dimensional Viewing
CHAPTER 6 3-Dimensional Vieing Vieing and projection Objects in orld coordinates are projected on to the vie plane, hich is defined perpendicular to the vieing direction along the v -ais. The to main tpes
More informationThink About. Unit 5 Lesson 3. Investigation. This Situation. Name: a Where do you think the origin of a coordinate system was placed in creating this
Think About This Situation Unit 5 Lesson 3 Investigation 1 Name: Eamine how the sequence of images changes from frame to frame. a Where do ou think the origin of a coordinate sstem was placed in creating
More information(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates
Coordinate Sstems Point Representation in two dimensions Cartesian Coordinates: (; ) Polar Coordinates: (; ) (, ) ρ θ (ρ, θ) Cartesian Coordinates Polar Coordinates p = CPS1, 9: Computer Graphics D Geometric
More informationCS Computer Graphics: Transformations & The Synthetic Camera
CS 543 - Computer Graphics: Transformations The Snthetic Camera b Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Introduction to Transformations A transformation changes an objects Size
More informationCS 335 Graphics and Multimedia. Geometric Warping
CS 335 Graphics and Multimedia Geometric Warping Geometric Image Operations Eample transformations Straightforward methods and their problems The affine transformation Transformation algorithms: Forward
More informationReteaching Golden Ratio
Name Date Class Golden Ratio INV 11 You have investigated fractals. Now ou will investigate the golden ratio. The Golden Ratio in Line Segments The golden ratio is the irrational number 1 5. c On the line
More informationPolynomials. Math 4800/6080 Project Course
Polnomials. Math 4800/6080 Project Course 2. The Plane. Boss, boss, ze plane, ze plane! Tattoo, Fantas Island The points of the plane R 2 are ordered pairs (x, ) of real numbers. We ll also use vector
More informationLecture 4: Viewing. Topics:
Lecture 4: Viewing Topics: 1. Classical viewing 2. Positioning the camera 3. Perspective and orthogonal projections 4. Perspective and orthogonal projections in OpenGL 5. Perspective and orthogonal projection
More information3D Coordinates & Transformations
3D Coordinates & Transformations Prof. Aaron Lanterman (Based on slides b Prof. Hsien-Hsin Sean Lee) School of Electrical and Computer Engineering Georgia Institute of Technolog 3D graphics rendering pipeline
More informationLinear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ x + 5y + 7z 9x + 3y + 11z
Basic Linear Algebra Linear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ 1 5 ] 7 9 3 11 Often matrices are used to describe in a simpler way a series of linear equations.
More information2D Transformations. 7 February 2017 Week 5-2D Transformations 1
2D Transformations 7 Februar 27 Week 5-2D Transformations Matri math Is there a difference between possible representations? a c b e d f ae bf ce df a c b d e f ae cf be df a b c d e f ae bf ce df 7 Februar
More information10.1 Curves Defined by Parametric Equations
10.1 Curves Defined by Parametric Equations Ex: Consider the unit circle from Trigonometry. What is the equation of that circle? There are 2 ways to describe it: x 2 + y 2 = 1 and x = cos θ y = sin θ When
More informationModule Four: Connecting Algebra and Geometry Through Coordinates
NAME: Period: Module Four: Connecting Algebra and Geometry Through Coordinates Topic A: Rectangular and Triangular Regions Defined by Inequalities Lesson 1: Searching a Region in the Plane Lesson 2: Finding
More informationCommon Core Standards Addressed in this Resource
Common Core Standards Addressed in this Resource N-CN.4 - Represent complex numbers on the complex plane in rectangular and polar form (including real and imaginary numbers), and explain why the rectangular
More informationImage Warping, mesh, and triangulation CSE399b, Spring 07 Computer Vision
http://grail.cs.washington.edu/projects/rotoscoping/ Image Warping, mesh, and triangulation CSE399b, Spring 7 Computer Vision Man of the slides from A. Efros. Parametric (global) warping Eamples of parametric
More informationVector Algebra Transformations. Lecture 4
Vector Algebra Transformations Lecture 4 Cornell CS4620 Fall 2008 Lecture 4 2008 Steve Marschner 1 Geometry A part of mathematics concerned with questions of size, shape, and relative positions of figures
More informationCS770/870 Spring 2017 Transformations
CS770/870 Spring 2017 Transformations Coordinate sstems 2D Transformations Homogeneous coordinates Matrices, vectors, points 01/29/2017 1 Coordinate Sstems Coordinate sstems used in graphics Screen coordinates:
More informationHonors Advanced Math More on Determinants, Transformations and Systems 14 May 2013
Honors Advanced Math Name: More on Determinants, Transformations and Sstems 14 Ma 013 Directions: The following problems are designed to help develop connections between determinants, sstems of equations
More informationCS 157: Assignment 6
CS 7: Assignment Douglas R. Lanman 8 Ma Problem : Evaluating Conve Polgons This write-up presents several simple algorithms for determining whether a given set of twodimensional points defines a conve
More informationUsing Polar Coordinates. Graphing and converting polar and rectangular coordinates
Using Polar Coordinates Graphing and converting polar and rectangular coordinates Butterflies are among the most celebrated of all insects. It s hard not to notice their beautiful colors and graceful flight.
More informationTo Do. Course Outline. Course Outline. Goals. Motivation. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1
Fondations of Compter Graphics (Fall 212) CS 184, Lectre 3: Transformations 1 http://inst.eecs.berkele.ed/~cs184 Sbmit HW b To Do Start looking at HW 1 (simple, bt need to think) Ais-angle rotation and
More informationTHE INVERSE GRAPH. Finding the equation of the inverse. What is a function? LESSON
LESSON THE INVERSE GRAPH The reflection of a graph in the line = will be the graph of its inverse. f() f () The line = is drawn as the dotted line. Imagine folding the page along the dotted line, the two
More informationDEFINITIONS. Perpendicular Two lines are called perpendicular if they form a right angle.
DEFINITIONS Degree A degree is the 1 th part of a straight angle. 180 Right Angle A 90 angle is called a right angle. Perpendicular Two lines are called perpendicular if they form a right angle. Congruent
More informationWarping, Morphing and Mosaics
Computational Photograph and Video: Warping, Morphing and Mosaics Prof. Marc Pollefes Dr. Gabriel Brostow Toda s schedule Last week s recap Warping Morphing Mosaics Toda s schedule Last week s recap Warping
More informationModeling Transformations
Modeling Transformations Michael Kazhdan (601.457/657) HB Ch. 5 FvDFH Ch. 5 Announcement Assignment 2 has been posted: Due: 10/24 ASAP: Download the code and make sure it compiles» On windows: just build
More informationMath background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6
Math background 2D Geometric Transformations CS 4620 Lecture 6 Read: Chapter 2: Miscellaneous Math Chapter 5: Linear Algebra Notation for sets, functions, mappings Linear transformations Matrices Matrix-vector
More informationTransformations II. Week 2, Wed Jan 17
Universit of British Columbia CPSC 34 Computer Graphics Jan-Apr 27 Tamara Munzner Transformations II Week 2, Wed Jan 7 http://www.ugrad.cs.ubc.ca/~cs34/vjan27 Readings for Jan 5-22 FCG Chap 6 Transformation
More information1 Points and Distances
Ale Zorn 1 Points and Distances 1. Draw a number line, and plot and label these numbers: 0, 1, 6, 2 2. Plot the following points: (A) (3,1) (B) (2,5) (C) (-1,1) (D) (2,-4) (E) (-3,-3) (F) (0,4) (G) (-2,0)
More informationWhat does OpenGL do?
Theor behind Geometrical Transform What does OpenGL do? So the user specifies a lot of information Ee Center Up Near, far, UP EE Left, right top, bottom, etc. f b CENTER left right top bottom What does
More informationGeometric Model of Camera
Geometric Model of Camera Dr. Gerhard Roth COMP 42A Winter 25 Version 2 Similar Triangles 2 Geometric Model of Camera Perspective projection P(X,Y,Z) p(,) f X Z f Y Z 3 Parallel lines aren t 4 Figure b
More informationMath 20C. Lecture Examples.
Math 0C. Lecture Eamples. (8/30/08) Section 14.1, Part 1. Functions of two variables Definition 1 A function f of the two variables and is a rule = f(,) that assigns a number denoted f(,), to each point
More informationGLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner
GLOBAL EDITION Interactive Computer Graphics A Top-Down Approach with WebGL SEVENTH EDITION Edward Angel Dave Shreiner This page is intentionall left blank. 4.10 Concatenation of Transformations 219 in
More informationImage Warping. Many slides from Alyosha Efros + Steve Seitz. Photo by Sean Carroll
Image Warping Man slides from Alosha Efros + Steve Seitz Photo b Sean Carroll Morphing Blend from one object to other with a series of local transformations Image Transformations image filtering: change
More informationPresented, and Compiled, By. Bryan Grant. Jessie Ross
P a g e 1 Presented, and Compiled, By Bryan Grant Jessie Ross August 3 rd, 2016 P a g e 2 Day 1 Discovering Polar Graphs Days 1 & 2 Adapted from Nancy Stephenson - Clements High School, Sugar Land, Texas
More informationMEM380 Applied Autonomous Robots Winter Robot Kinematics
MEM38 Applied Autonomous obots Winter obot Kinematics Coordinate Transformations Motivation Ultimatel, we are interested in the motion of the robot with respect to a global or inertial navigation frame
More informationCMSC 425: Lecture 10 Basics of Skeletal Animation and Kinematics
: Lecture Basics of Skeletal Animation and Kinematics Reading: Chapt of Gregor, Game Engine Architecture. The material on kinematics is a simplification of similar concepts developed in the field of robotics,
More informationMath 26: Fall (part 1) The Unit Circle: Cosine and Sine (Evaluating Cosine and Sine, and The Pythagorean Identity)
Math : Fall 0 0. (part ) The Unit Circle: Cosine and Sine (Evaluating Cosine and Sine, and The Pthagorean Identit) Cosine and Sine Angle θ standard position, P denotes point where the terminal side of
More informationImage Warping (Szeliski Sec 2.1.2)
Image Warping (Szeliski Sec 2..2) http://www.jeffre-martin.com CS94: Image Manipulation & Computational Photograph Aleei Efros, UC Berkele, Fall 7 Some slides from Steve Seitz Image Transformations image
More informationPolar Coordinates. 2, π and ( )
Polar Coordinates Up to this point we ve dealt exclusively with the Cartesian (or Rectangular, or x-y) coordinate system. However, as we will see, this is not always the easiest coordinate system to work
More informationMath 231E, Lecture 34. Polar Coordinates and Polar Parametric Equations
Math 231E, Lecture 34. Polar Coordinates and Polar Parametric Equations 1 Definition of polar coordinates Let us first recall the definition of Cartesian coordinates: to each point in the plane we can
More informationFall 2016 Semester METR 3113 Atmospheric Dynamics I: Introduction to Atmospheric Kinematics and Dynamics
Fall 2016 Semester METR 3113 Atmospheric Dynamics I: Introduction to Atmospheric Kinematics and Dynamics Lecture 5 August 31 2016 Topics: Polar coordinate system Conversion of polar coordinates to 2-D
More informationPARAMETRIC EQUATIONS AND POLAR COORDINATES
9 ARAMETRIC EQUATIONS AND OLAR COORDINATES So far we have described plane curves b giving as a function of f or as a function of t or b giving a relation between and that defines implicitl as a function
More information2-D Geometry for Programming Contests 1
2-D Geometry for Programming Contests 1 1 Vectors A vector is defined by a direction and a magnitude. In the case of 2-D geometry, a vector can be represented as a point A = (x, y), representing the vector
More informationMATHEMATICS FOR ENGINEERING TRIGONOMETRY
MATHEMATICS FOR ENGINEERING TRIGONOMETRY TUTORIAL SOME MORE RULES OF TRIGONOMETRY This is the one of a series of basic tutorials in mathematics aimed at beginners or anyone wanting to refresh themselves
More informationScript for the Excel-based applet StereogramHeijn_v2.2.xls
Script for the Excel-based applet StereogramHeijn_v2.2.xls Heijn van Gent, MSc. 25.05.2006 Aim of the applet: The aim of this applet is to plot planes and lineations in a lower Hemisphere Schmidt Net using
More informationIMGD The Game Development Process: 3D Modeling and Transformations
IMGD - The Game Development Process: 3D Modeling and Transformations b Robert W. Lindeman (gogo@wpi.edu Kent Quirk (kent_quirk@cognito.com (with lots of input from Mark Clapool! Overview of 3D Modeling
More information2D Geometric Transformations and Matrices
Background: Objects are drawn and moved in 2D space and 3D space on a computer screen b multipling matrices. Generall speaking, computer animation is achieved as follows b repeating steps 1, 2, and 3 below.
More informationGeometric Transformations
Geometric Transformations CS 4620 Lecture 9 2017 Steve Marschner 1 A little quick math background Notation for sets, functions, mappings Linear and affine transformations Matrices Matrix-vector multiplication
More informationPre-Calc Unit 14: Polar Assignment Sheet April 27 th to May 7 th 2015
Pre-Calc Unit 14: Polar Assignment Sheet April 27 th to May 7 th 2015 Date Objective/ Topic Assignment Did it Monday Polar Discovery Activity pp. 4-5 April 27 th Tuesday April 28 th Converting between
More informationImage Warping CSE399b, Spring 07 Computer Vision
Image Warping CSE399b, Spring 7 Computer Vision http://maps.a9.com http://www.cs.ubc.ca/~mbrown/autostitch/autostitch.html http://www.cs.ubc.ca/~mbrown/autostitch/autostitch.html Autostiching on A9.com
More informationConnecting Algebra and Geometry with Polygons
Connecting Algebra and Geometr with Polgons 15 Circles are reall important! Once ou know our wa around a circle, ou can use this knowledge to figure out a lot of other things! 15.1 Name That Triangle!
More information3 Coordinates. 3.1 Prologue
3 Coordinates 3. Prologue Coordinates describe the location of a point or an object using numbers. If ou are shipwrecked somewhere off the coast of Patagonia and radioing for help, ou can sa, I am somewhere
More information