Class PolygonPerspectiveTransformation
- java.lang.Object
-
- ch.sahits.game.openpatrician.javafx.effects.transform.PolygonPerspectiveTransformation
-
public class PolygonPerspectiveTransformation extends java.lang.ObjectThe 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 Summary
Constructors Constructor Description PolygonPerspectiveTransformation()Initializing the transormation by adding transformation listeners on the points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Translation2DgetPoint1()Translation2DgetPoint2()Translation2DgetPoint3()javafx.beans.property.ObjectProperty<Translation2D>point1Property()javafx.beans.property.ObjectProperty<Translation2D>point2Property()javafx.beans.property.ObjectProperty<Translation2D>point3Property()voidsetPoint1(Translation2D value)voidsetPoint2(Translation2D value)voidsetPoint3(Translation2D value)javafx.scene.shape.Polygontransform(javafx.scene.shape.Polygon polygon)Transform a polygon using the defined perspective transformation
-
-
-
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.
-
getPoint3
public Translation2D getPoint3()
-
setPoint3
public void setPoint3(Translation2D value)
-
point3Property
public javafx.beans.property.ObjectProperty<Translation2D> point3Property()
-
getPoint2
public Translation2D getPoint2()
-
setPoint2
public void setPoint2(Translation2D value)
-
point2Property
public javafx.beans.property.ObjectProperty<Translation2D> point2Property()
-
getPoint1
public Translation2D getPoint1()
-
setPoint1
public void setPoint1(Translation2D value)
-
point1Property
public javafx.beans.property.ObjectProperty<Translation2D> point1Property()
-
-