Class Affine

java.lang.Object
javafx.scene.transform.Transform
javafx.scene.transform.Affine
All Implemented Interfaces:
Cloneable, EventTarget

public class Affine extends Transform

The Affine class represents a general affine transform. An affine transform performs a linear mapping from 2D/3D coordinates to other 2D/3D coordinates while preserving the "straightness" and "parallelness" of lines. Affine transformations can be constructed using sequence rotations, translations, scales, and shears.

For simple transformations application developers should use the specific Translate, Scale, Rotate, or Shear transforms, which are more lightweight and thus more optimal for this simple purpose. The Affine class, on the other hand, has the advantage of being able to represent a general affine transform and perform matrix operations on it in place, so it fits better for more complex transformation usages.

Such a coordinate transformation can be represented by a 3 row by 4 column matrix. This matrix transforms source coordinates (x,y,z) into destination coordinates (x',y',z') by considering them to be a column vector and multiplying the coordinate vector by the matrix according to the following process:

      [ x']   [  mxx  mxy  mxz  tx  ] [ x ]   [ mxx * x + mxy * y + mxz * z + tx ]
      [ y'] = [  myx  myy  myz  ty  ] [ y ] = [ myx * x + myy * y + myz * z + ty ]
      [ z']   [  mzx  mzy  mzz  tz  ] [ z ]   [ mzx * x + mzy * y + mzz * z + tz ]
                                      [ 1 ]
 
Since:
JavaFX 2.0