Overview
An effect that provides non-affine transformation of the input content.
Most typically PerspectiveTransform
is used to provide a "faux"
three-dimensional effect for otherwise two-dimensional content.
A perspective transformation is capable of mapping an arbitrary quadrilateral into another arbitrary quadrilateral, while preserving the straightness of lines. Unlike an affine transformation, the parallelism of lines in the source is not necessarily preserved in the output.
Note that this effect does not adjust the coordinates of input events
or any methods that measure containment on a Node
.
The results of mouse picking and the containment methods are undefined
when a Node
has a PerspectiveTransform
effect in place.
the code:
import javafx.scene.*;
import javafx.scene.shape.*;
import javafx.scene.text.*;
import javafx.scene.paint.*;
import javafx.scene.effect.*;
Group {
effect: PerspectiveTransform {
ulx: 10 uly: 10
urx: 310 ury: 40
lrx: 310 lry: 60
llx: 10 lly: 90
}
cache: true
content: [
Rectangle {
x: 10 y: 10
width: 280
height: 80
fill: Color.BLUE
},
Text {
x: 20 y: 65
content: "Perspective"
fill: Color.YELLOW
font: Font.font(null, FontWeight.BOLD, 36);
},
]
}
produces:
Profile: common conditional effect
Variable Summary
access | name | type | Can Read | Can Init | Can Write | Default Value | description |
---|---|---|---|---|---|---|---|
public | input | Effect | null |
The input for this The input for this |
|||
public | llx | Number | 0.0 |
The x coordinate of the output location onto which the lower left corner of the source is mapped. |
|||
public | lly | Number | 0.0 |
The y coordinate of the output location onto which the lower left corner of the source is mapped. |
|||
public | lrx | Number | 0.0 |
The x coordinate of the output location onto which the lower right corner of the source is mapped. |
|||
public | lry | Number | 0.0 |
The y coordinate of the output location onto which the lower right corner of the source is mapped. |
|||
public | ulx | Number | 0.0 |
The x coordinate of the output location onto which the upper left corner of the source is mapped. |
|||
public | uly | Number | 0.0 |
The y coordinate of the output location onto which the upper left corner of the source is mapped. |
|||
public | urx | Number | 0.0 |
The x coordinate of the output location onto which the upper right corner of the source is mapped. |
|||
public | ury | Number | 0.0 |
The y coordinate of the output location onto which the upper right corner of the source is mapped. |