SlideServe
Menu
Préférences
© SlideServe · v2026

CAP4730: Computational Structures in Computer Graphics

sun avatar
47 diapositives · 715 Views · Jun 28, 2012

CAP4730: Computational Structures in Computer Graphics. 2D Transformations. 2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Putting it all together. Transformations. Rigid Body Transformations - transformations that do not change the object. Translate

CAP4730: Computational Structures in Computer Graphics - slide 1
01 / 47CAP4730: Computational Structures in Computer Graphics
1 / 17

Télécharger la présentation

CAP4730: Computational Structures in Computer Graphics
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. CAP4730: Computational Structures in Computer Graphics 2D Transformations

  2. 2D Transformations • World Coordinates • Translate • Rotate • Scale • Viewport Transforms • Putting it all together

  3. Transformations • Rigid Body Transformations - transformations that do not change the object. • Translate • If you translate a rectangle, it is still a rectangle • Scale • If you scale a rectangle, it is still a rectangle • Rotate • If you rotate a rectangle, it is still a rectangle

  4. Vertices • We have always represented vertices as (x,y) • An alternate method is: • Example:

  5. Matrix * Vector

  6. Matrix * Matrix Does A*B = B*A? What does the identity do?

  7. Practice

  8. Translation • Translation - repositioning an object along a straight-line path (the translation distances) from one coordinate location to another. (x’,y’) (tx,ty) (x,y)

  9. Translation • Given: • We want: • Matrix form:

  10. Translation Examples • P=(2,4), T=(-1,14), P’=(?,?) • P=(8.6,-1), T=(0.4,-0.2), P’=(?,?) • P=(0,0), T=(1,0), P’=(?,?)

  11. Which one is it? (x’,y’) (tx,ty) (tx,ty) (x,y) (x,y)

  12. Recall • A point is a position specified with coordinate values in some reference frame. • We usually label a point in this reference point as the origin. • All points in the reference frame are given with respect to the origin.

  13. Applying to Triangles (tx,ty)

  14. What do we have here? • You know how to:

  15. Scale • Scale - Alters the size of an object. • Scales about a fixed point (x’,y’) (x,y)

  16. Scale • Given: • We want: • Matrix form:

  17. Non-Uniform/Differential Scalin’ (x’,y’) (x,y) S=(1,2)

  18. Rotation • Rotation - repositions an object along a circular path. • Rotation requires an  and a pivot point

  19. Rotation

  20. Example • P=(4,4) • =45 degrees

  21. What is the difference? Revisited V(-0.6,0) V(0,-0.6) V(0.6,0.6) Translate (1.2,0.3) V(0,0.6) V(0.3,0.9) V(0,1.2) Translate (1.2,0.3) V(0.6,0.3) V(1.2,-0.3) V(1.8,0.9) V(0,0.6) V(0.3,0.9) V(0,1.2)

  22. Rotations V(-0.6,0) V(0,-0.6) V(0.6,0.6) Rotate -30 degrees V(0,0.6) V(0.3,0.9) V(0,1.2)

  23. Combining Transformations Q: How do we specify each transformation?

  24. Specifying 2D Transformations • Translation • T(tx, ty) • Translation distances • Scale • S(sx,sy) • Scale factors • Rotation • R() • Rotation angle

  25. Combining Transformations • Using translate, rotation, and scale, how do we get:

  26. Combining Transformations • Note there are two ways to combine rotation and translation. Why?

  27. Let’s look at the equations

  28. Combining them • We must do each step in turn. First we rotate the points, then we translate, etc. • Since we can represent the transformations by matrices, why don’t we just combine them?

  29. 2x2 -> 3x3 Matrices • We can combine transformations by expanding from 2x2 to 3x3 matrices.

  30. Homogenous Coordinates • We need to do something to the vertices • By increasing the dimensionality of the problem we can transform the addition component of Translation into multiplication.

  31. Homogenous Coordinates • Homogenous Coordinates - term used in mathematics to refer to the effect of this representation on Cartesian equations. Converting a pt(x,y) and f(x,y)=0 -> (xh,yh,h) then in homogenous equations mean (v*xh,v*yh,v*h) can be factored out. • What you should get: By expressing the transformations with homogenous equations and coordinates, all transformations can be expressed as matrix multiplications.

  32. Final Transformations - Compare Equations

  33. Combining Transformations

  34. How would we get:

  35. How would we get:

  36. Coordinate Systems • Object Coordinates • World Coordinates • Eye Coordinates

  37. Object Coordinates

  38. World Coordinates

  39. Screen Coordinates

  40. Coordinate Hierarchy

  41. Let’s reexamine assignment 2b

  42. Transformation Hierarchies • For example:

  43. Transformation Hierarchies • Let’s examine:

  44. Transformation Hierarchies • What is a better way?

  45. Transformation Hierarchies • What is a better way?

  46. Transformation Hierarchies • We can have transformations be in relation to each other

  47. More Complex Models