public class PolygonPerspectiveTransformation extends Object
.
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.| Type | Property and Description |
|---|---|
javafx.beans.property.ObjectProperty<Translation2D> |
point1 |
javafx.beans.property.ObjectProperty<Translation2D> |
point2 |
javafx.beans.property.ObjectProperty<Translation2D> |
point3 |
| Modifier and Type | Class and Description |
|---|---|
private class |
PolygonPerspectiveTransformation.RecalculationEventListener
Ensure that the values are recalculated on property change.
|
| Modifier and Type | Field and Description |
|---|---|
private double |
a11 |
private double |
a12 |
private double |
a21 |
private double |
a22 |
private double |
b1 |
private double |
b2 |
private static Translation2D |
ORIGIN_ORIGIN |
private javafx.beans.property.ObjectProperty<Translation2D> |
point1 |
private javafx.beans.property.ObjectProperty<Translation2D> |
point2 |
private javafx.beans.property.ObjectProperty<Translation2D> |
point3 |
| Constructor and Description |
|---|
PolygonPerspectiveTransformation()
Initializing the transormation by adding transformation listeners on the points.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
calculate()
Recalculate the matrix values based on the points.
|
private double |
calculateA11() |
private double |
calculateA12() |
private double |
calculateA21() |
private double |
calculateA22() |
private double |
calculateB1() |
private double |
calculateB2() |
private List<javafx.geometry.Point2D> |
convertToPoints(javafx.collections.ObservableList<Double> points) |
Translation2D |
getPoint1()
Gets the value of the property point1.
|
Translation2D |
getPoint2()
Gets the value of the property point2.
|
Translation2D |
getPoint3()
Gets the value of the property point3.
|
javafx.beans.property.ObjectProperty<Translation2D> |
point1Property() |
javafx.beans.property.ObjectProperty<Translation2D> |
point2Property() |
javafx.beans.property.ObjectProperty<Translation2D> |
point3Property() |
void |
setPoint1(Translation2D value)
Sets the value of the property point1.
|
void |
setPoint2(Translation2D value)
Sets the value of the property point2.
|
void |
setPoint3(Translation2D value)
Sets the value of the property point3.
|
javafx.scene.shape.Polygon |
transform(javafx.scene.shape.Polygon polygon)
Transform a polygon using the defined perspective transformation
|
private static final Translation2D ORIGIN_ORIGIN
private final javafx.beans.property.ObjectProperty<Translation2D> point1
private final javafx.beans.property.ObjectProperty<Translation2D> point2
private final javafx.beans.property.ObjectProperty<Translation2D> point3
private double a11
private double a12
private double a21
private double a22
private double b1
private double b2
public PolygonPerspectiveTransformation()
private void calculate()
private double calculateA12()
private double calculateA11()
private double calculateB1()
private double calculateA22()
private double calculateA21()
private double calculateB2()
public javafx.scene.shape.Polygon transform(javafx.scene.shape.Polygon polygon)
polygon - private List<javafx.geometry.Point2D> convertToPoints(javafx.collections.ObservableList<Double> points)
public Translation2D getPoint3()
public void setPoint3(Translation2D value)
public javafx.beans.property.ObjectProperty<Translation2D> point3Property()
public Translation2D getPoint2()
public void setPoint2(Translation2D value)
public javafx.beans.property.ObjectProperty<Translation2D> point2Property()
public Translation2D getPoint1()
public void setPoint1(Translation2D value)
public javafx.beans.property.ObjectProperty<Translation2D> point1Property()
Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.