user8929955 wrote:You can't use Affine Transformations to map a rectangle into an arbitrary quadrilateral. Affine Transformations preserve parallelism: so you can only transform a rectangle into another parallelogram.
I'm trying to figure out how to create a transformation to deform a rectangle into a quadrangle, where one corner stays the same. The basic mathematical solution is clear as described in [this Wiki article|http://en.wikipedia.org/wiki/Affine_transformation] .
There are two questions I would like to pose:The API defines Affine Transformations, and then Translations, Scales, Rotations, and Shears. You can (if I remember my Linear Algebra correctly) construct any Affine Transformation by composing translations, scale transformations, rotations, and shears. There's no API for non-affine transformations that I am aware of.
1. Has anyone done this already?
2. Basically this could also be achieved by concatenating simpler transformation (scale, rotation, projection). While scale and rotation is available in JavaFX I wonder how to define projection in a simple way? Projection in this context would mean that I have one edge and then scale the opposing edge in- or outward. This would make a trapeze out of the rectangle. How would such a transformation matrix look like?