Class PolygonPerspectiveTransformation


  • public class PolygonPerspectiveTransformation
    extends java.lang.Object
    The perspective transformation can be expressed as a matrix multiplication: http://upload.wikimedia.org/math/d/6/5/d65e582afbf418e4989971cdee42a167.png. The transformation matrix of a polygon is defined by the transformation of the bounding box of the polygon. The general case where the four corners of the bounding box are translated can be reduced to the special case where only three corners are translated. Therefore this transformation algorithm will take the source and destination points in 2D space of the three corners that are moved.
    Author:
    andi
    • Constructor Detail

      • PolygonPerspectiveTransformation

        public PolygonPerspectiveTransformation()
        Initializing the transormation by adding transformation listeners on the points.
    • Method Detail

      • transform

        public javafx.scene.shape.Polygon transform​(javafx.scene.shape.Polygon polygon)
        Transform a polygon using the defined perspective transformation
        Parameters:
        polygon - untransformed polygon
        Returns:
        polygon with applied transformation.
      • point3Property

        public javafx.beans.property.ObjectProperty<Translation2D> point3Property()
      • point2Property

        public javafx.beans.property.ObjectProperty<Translation2D> point2Property()
      • point1Property

        public javafx.beans.property.ObjectProperty<Translation2D> point1Property()