1 / 35

Affine Transformations

Affine Transformations. Jim Van Verth NVIDIA Corporation ( jim@essentialmath.com ). Topics. What’s an affine transformation? How to generate various forms Things to watch out for. What is it?. A mapping between affine spaces Preserves lines (& planes) Preserves parallel lines

Download Presentation

Affine Transformations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Affine Transformations Jim Van Verth NVIDIA Corporation (jim@essentialmath.com)

  2. Topics • What’s an affine transformation? • How to generate various forms • Things to watch out for

  3. What is it? • A mapping between affine spaces • Preserves lines (& planes) • Preserves parallel lines • But not angles or distances • Can represent as • (note we’re using column vectors)

  4. Affine Space • Collection of points and vectors • Can be represented using frame • Within frame, vector and point j = (0,1) O i = (1,0)

  5. Affine Transformation • Key idea: map from space to space by using frames • Note how axes change (A) • Note how origin changes (y)

  6. Example: Translation • Axes don’t change • Origin moves by y y

  7. Example: Rotation • Axes change • Origin doesn’t move • But what is A?

  8. Example: Rotation • Follow the axes: • New axes go in columns of matrix (-sin q, cos q) (cos q, sin q) q q

  9. Example: Scale • Axes change • Origin doesn’t move • Again, what is A?

  10. Example: Scale • Follow the axes: • New axes go in columns of matrix (0, 0.5) (1.5, 0)

  11. Example: Reflection • Axes change • Origin doesn’t move • But what, oh what, is A?

  12. Example: Reflection • Follow the axes: • New axes go in columns of matrix (0, 1) (-1, 0)

  13. Example: Shear • Axes change • Origin doesn’t move • Hey, hey, what is A?

  14. Example: Shear • Follow the axes: • New axes go in columns of matrix (0.5, 1) (1, 0)

  15. Transform Types • Rigid-body transformation • Translation • Rotation • Deformable transformation • Scale • Reflection • Shear

  16. Combining Transforms • Simple function composition

  17. Combining Transforms • Order is important! • Scale, then rotate

  18. Combining Transforms • Order is important! • Rotate, then scale

  19. Local and World Frames • Objects built in local frame • Want to place in world frame • Local-to-world transformation • Same basic idea: determine where axes and origin end up in world frame

  20. World to Local Frame • Similar, but in reverse • Want transformation relative to local frame • Often easier to just take the inverse • Example: world-to-view transformation

  21. Inverse • Reverses the effect of a transformation • Easy to do with formula: • For matrix, just use matrix inverse

  22. Matrix Form • Necessary for many APIs • Is easy • Concatenate by matrix multiply • Can be faster on vector architectures • Takes more storage, though

  23. Object-centered Transform • Often get this case • Already have local-to-world transform • Want rotate/scale/whatever around local origin, not world origin • How?

  24. Object-Oriented Transform • One way • Translate to origin • Rotate there • Translate back

  25. Object-Oriented Transform • Using formula: • Translate to origin • Rotate there • Translate back • This works with arbitrary center in world frame!

  26. Alternate Format • Problem: want to • Translate object in space and change rotation and scale arbitrarily • Handle rotation/scale separately • Can’t do easily with matrix format or Ax + y form • Involves SVD, Polar decomposition • Messy, but we can do better using…

  27. Rigid Body Transforms • Any sequence of translation and rotation transformations • Not scale, reflection or shear • Object shape is not affected (preserves angles and lengths) • Usually include uniform scale despite this

  28. Alternate Format • Scale – one uniform scale factor s • Rotation – matrix R • Translation – single vector t

  29. Alternate Format • Want to concatenate transforms T1, T2 in this form, or • Do this by

  30. Alternate Format • Advantages • Clear what each part does • Easier to change individual elements • Disadvantages • Eventually have to convert to 4x4 matrix anyway for renderer/video card • 4x4 faster on vector architecture

  31. Alternate Format • Matrix conversion

  32. Inverting Rigid Body Xforms • We can easily invert our rigid body transforms symbolically:

  33. Inverting Rigid Body Xforms (2) • In fact, the result itself may be written as a rigid body transform:

  34. References • Rogers, F. David and J. Alan Adams, Mathematical Elements for Computer Graphics, 2nd Ed, McGraw-Hill, 1990. • Watt, Alan, 3D Computer Graphics, Addison-Wesley, Wokingham, England, 1993.

More Related