Search code examples
javaaffinetransform

What is AffineTransform?


I'm reading "Beginning Java Game Programming 2/e" and the book heavily emphasizes using AffineTransform.

There is just one problem, it doesn't explain at all what it is, what it does, and the purpose of AffineTransform.

I have done some google searches, but they're just showing me matrix math... Could someone point me in the right direction?


Solution

  • That's because an affine transform is matrix math. It's any kind of mapping from one image to another that you can construct by moving, scaling, rotating, reflecting, and/or shearing the image. The Java AffineTransform class lets you specify these kinds of transformations, then use them to produce modified versions of images.