This camera defines a viewing volume for a perspective projection;
a truncated right pyramid.
The fieldOfView value can be used to change viewing volume.
By default, this camera is located at center of the scene and looks along the
positive z-axis. The coordinate system defined by this camera has its
origin in the upper left corner of the panel with the Y-axis pointing
down and the Z axis pointing away from the viewer (into the screen).
If a PerspectiveCamera node is added to the scene graph,
the transformed position and orientation of the camera will define the
position of the camera and the direction that the camera is looking.
In the default camera, where fixedEyeAtCameraZero is false, the Z value
of the eye position is adjusted in Z such that the projection matrix generated
using the specified fieldOfView will produce units at
Z = 0 (the projection plane), in device-independent pixels, matches that of
the ParallelCamera.
When the Scene is resized,
the objects in the scene at the projection plane (Z = 0) will stay the same size,
but more or less content of the scene is viewable.
If fixedEyeAtCameraZero is true, the eye position is fixed at (0, 0, 0)
in the local coordinates of the camera. The projection matrix is generated
using the specified fieldOfView and the projection volume is mapped
onto the viewport (window) such that it is stretched over more or fewer
device-independent pixels at the projection plane.
When the Scene is resized,
the objects in the scene will shrink or grow proportionally,
but the visible portion of the content is unchanged.
We recommend setting fixedEyeAtCameraZero to true if you are going to transform (move) the camera. Transforming the camera when fixedEyeAtCameraZero is set to false may lead to results that are not intuitive.
Note that this is a conditional feature. See
ConditionalFeature.
for more information.
| Modifier and Type | Field and Description |
|---|---|
| private DoubleProperty | fieldOfView
Specifies the field of view angle of the camera's projection, measured in degrees. |
| private boolean | |
| private static final Affine3D | |
| private static final Affine3D | |
| private BooleanProperty | verticalFieldOfView
Defines whether the |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PerspectiveCamera(boolean
true if the the eye position is fixed at
(0, 0, 0) in the local coordinates of the camera. fixedEyeAtCameraZero)Constructs a PerspectiveCamera with the specified fixedEyeAtCameraZero flag. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final PickRay | computePickRay(double
horizontal coordinate of the pick ray in the projected
view, usually mouse cursor position x, double vertical coordinate of the pick ray in the projected
view, usually mouse cursor position y, PickRay pick ray to be reused. New instance is created in case
of null. pickRay)Implements abstract javafx. Computes pick ray for the content rendered by this camera. |
| pack-priv Vec3d | computePosition(Vec3d
Position to be reused. New instance is created in case
of null. position)Implements abstract javafx. Computes local position of the camera in the scene. |
| pack-priv void | computeProjectionTransform(GeneralTransform3D proj)
Implements abstract javafx.
|
| pack-priv void | |
| pack-priv Camera | |
| private NGNode | |
| private void | |
| public final DoubleProperty | |
| public final double | |
| public final boolean | Returns: a flag indicating whether this camera uses a fixed eye position at the origin of the cameraReturns a flag indicating whether this camera uses a fixed eye position at the origin of the camera. |
| public final boolean | |
| public final void | |
| public final void | |
| public final BooleanProperty |
| fieldOfView | back to summary |
|---|---|
| private DoubleProperty fieldOfView Specifies the field of view angle of the camera's projection, measured in degrees.
| |
| fixedEyeAtCameraZero | back to summary |
|---|---|
| private boolean fixedEyeAtCameraZero | |
| LOOK_AT_TX | back to summary |
|---|---|
| private static final Affine3D LOOK_AT_TX | |
| LOOK_AT_TX_FIXED_EYE | back to summary |
|---|---|
| private static final Affine3D LOOK_AT_TX_FIXED_EYE | |
| verticalFieldOfView | back to summary |
|---|---|
| private BooleanProperty verticalFieldOfView Defines whether the
| |
| PerspectiveCamera | back to summary |
|---|---|
| public PerspectiveCamera() Creates an empty instance of PerspectiveCamera. | |
| PerspectiveCamera | back to summary |
|---|---|
| public PerspectiveCamera(boolean fixedEyeAtCameraZero) Constructs a PerspectiveCamera with the specified fixedEyeAtCameraZero flag. In the default camera, where fixedEyeAtCameraZero is false, the Z value of
the eye position is adjusted in Z such that the projection matrix generated
using the specified If fixedEyeAtCameraZero is true, the eye position is fixed at (0, 0, 0)
in the local coordinates of the camera. The projection matrix is generated
using the specified We recommend setting fixedEyeAtCameraZero to true if you are going to transform (move) the camera. Transforming the camera when fixedEyeAtCameraZero is set to false may lead to results that are not intuitive.
| |
| computePickRay | back to summary |
|---|---|
| pack-priv final PickRay computePickRay(double x, double y, PickRay pickRay) Implements abstract javafx. Doc from javafx. Computes pick ray for the content rendered by this camera.
| |
| computePosition | back to summary |
|---|---|
| pack-priv Vec3d computePosition(Vec3d position) Implements abstract javafx. Doc from javafx. Computes local position of the camera in the scene. | |
| computeProjectionTransform | back to summary |
|---|---|
| pack-priv void computeProjectionTransform(GeneralTransform3D proj) Implements abstract javafx.
| |
| computeViewTransform | back to summary |
|---|---|
| pack-priv void computeViewTransform(Affine3D view) Implements abstract javafx.
| |
| copy | back to summary |
|---|---|
| pack-priv Camera copy() Overrides javafx.
| |
| doCreatePeer | back to summary |
|---|---|
| private NGNode doCreatePeer() | |
| doUpdatePeer | back to summary |
|---|---|
| private void doUpdatePeer() | |
| fieldOfViewProperty | back to summary |
|---|---|
| public final DoubleProperty fieldOfViewProperty() | |
| getFieldOfView | back to summary |
|---|---|
| public final double getFieldOfView() | |
| isFixedEyeAtCameraZero | back to summary |
|---|---|
| public final boolean isFixedEyeAtCameraZero() Returns a flag indicating whether this camera uses a fixed eye position
at the origin of the camera. If
| |
| isVerticalFieldOfView | back to summary |
|---|---|
| public final boolean isVerticalFieldOfView() | |
| setFieldOfView | back to summary |
|---|---|
| public final void setFieldOfView(double value) | |
| setVerticalFieldOfView | back to summary |
|---|---|
| public final void setVerticalFieldOfView(boolean value) | |
| verticalFieldOfViewProperty | back to summary |
|---|---|
| public final BooleanProperty verticalFieldOfViewProperty() | |