Chapter 34. Geometric and Color Transformations

FEATURED CLASSES

  • flash.geom.Transform

  • flash.geom.ColorTransform

  • flash.geom.Matrix3D

  • flash.geom.Vector3D

Geometric transformations, like moving, scaling, rotating, and skewing, and color transformations, like tint and brightness adjustment, can be represented as matrices. When you apply successive transformations, those transformation matrices are multiplied together so that the current state of an object can be represented by a single matrix, even though it may be the result of several transformations. Flash Player gives you access to these transformations with the flash.geom.Transform class. Using the properties of Transform, you can manipulate an object's geometric transformation matrices and its color transformations, giving you a more computer-graphics-centric interface to geometric transforms including position, scale, rotation, translation, and skew, and enabling basic manipulation of colors.

You can always manipulate the geometry of display objects with their properties like x and rotation. The transformation matrices introduced in this chapter provide a more powerful, mathematical interface to the same geometry. I hate to say it because it's so interesting, but you could consider this chapter optional.

To use transformation matrices, you'll need to understand some matrix math. In the section "Matrices and coordinates" I'll provide a brief introduction. When you get into 3D I'll provide another refresher in the section "Basic 3D concepts ...

Get ActionScript 3.0 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.