public abstract class Camera extends Node
ParallelCamera
and PerspectiveCamera
.
The default camera is positioned in the scene such that its projection plane
in the scene coordinate space is at Z = 0, and it is looking into the screen in
the positive Z direction. The distance in Z from the camera to the projection
plane is determined by the width
and height
of the Scene to
which it is attached and its fieldOfView
.
The nearClip
and farClip
of this camera are specified in the
eye coordinate space. This space is defined such that the eye is at its
origin and the projection plane is one unit in front of the eye in the
positive Z direction.
The following pseudo code is the math used to compute the near and far clip distances in the scene coordinate space:
final double tanOfHalfFOV = Math.tan(Math.toRadians(FOV) / 2.0); final double halfHeight = HEIGHT / 2; final double focalLenght = halfHeight / tanOfHalfFOV; final double eyePositionZ = -1.0 * focalLenght; final double nearClipDistance = focalLenght * NEAR + eyePositionZ; final double farClipDistance = focalLenght * FAR + eyePositionZ;where
FOV
is fieldOfView
in degrees,
NEAR
is nearClip
specified in eye space,
and FAR
is farClip
specified in eye space.
Note: Since the ParallelCamera class has no fieldOfView
property, a
30 degrees vertical field of view is used.
Note: For the case of a PerspectiveCamera where the fixedEyeAtCameraZero
attribute is true, the scene coordinate space is normalized in order to fit
into the view frustum (see PerspectiveCamera
for more details). In
this mode, the eye coordinate space is the same as this Camera node's local
coordinate space. Hence the conversion formula mentioned above is not used.
Type | Property and Description |
---|---|
DoubleProperty |
farClip
Specifies the distance from the eye of the far clipping plane of
this
Camera in the eye coordinate space. |
DoubleProperty |
nearClip
Specifies the distance from the eye of the near clipping plane of
this
Camera in the eye coordinate space. |
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, visible
BASELINE_OFFSET_SAME_AS_HEIGHT
Modifier | Constructor and Description |
---|---|
protected |
Camera() |
Modifier and Type | Method and Description |
---|---|
DoubleProperty |
farClipProperty()
Specifies the distance from the eye of the far clipping plane of
this
Camera in the eye coordinate space. |
double |
getFarClip()
Gets the value of the property farClip.
|
double |
getNearClip()
Gets the value of the property nearClip.
|
DoubleProperty |
nearClipProperty()
Specifies the distance from the eye of the near clipping plane of
this
Camera in the eye coordinate space. |
void |
setFarClip(double value)
Sets the value of the property farClip.
|
void |
setNearClip(double value)
Sets the value of the property nearClip.
|
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBaselineOffset, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getContentBias, getCssMetaData, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, prefHeight, prefWidth, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public final DoubleProperty nearClipProperty
Camera
in the eye coordinate space.
Objects closer to the eye than nearClip
are not drawn.
nearClip
is specified as a value greater than zero. A value less
than or equal to zero is treated as a very small positive number.getNearClip()
,
setNearClip(double)
public final DoubleProperty farClipProperty
Camera
in the eye coordinate space.
Objects farther away from the eye than farClip
are not
drawn.
farClip
is specified as a value greater than nearClip
.
A value less than or equal to nearClip
is treated as
nearClip
plus a very small positive number.getFarClip()
,
setFarClip(double)
public final void setNearClip(double value)
Camera
in the eye coordinate space.
Objects closer to the eye than nearClip
are not drawn.
nearClip
is specified as a value greater than zero. A value less
than or equal to zero is treated as a very small positive number.public final double getNearClip()
Camera
in the eye coordinate space.
Objects closer to the eye than nearClip
are not drawn.
nearClip
is specified as a value greater than zero. A value less
than or equal to zero is treated as a very small positive number.public final DoubleProperty nearClipProperty()
Camera
in the eye coordinate space.
Objects closer to the eye than nearClip
are not drawn.
nearClip
is specified as a value greater than zero. A value less
than or equal to zero is treated as a very small positive number.getNearClip()
,
setNearClip(double)
public final void setFarClip(double value)
Camera
in the eye coordinate space.
Objects farther away from the eye than farClip
are not
drawn.
farClip
is specified as a value greater than nearClip
.
A value less than or equal to nearClip
is treated as
nearClip
plus a very small positive number.public final double getFarClip()
Camera
in the eye coordinate space.
Objects farther away from the eye than farClip
are not
drawn.
farClip
is specified as a value greater than nearClip
.
A value less than or equal to nearClip
is treated as
nearClip
plus a very small positive number.public final DoubleProperty farClipProperty()
Camera
in the eye coordinate space.
Objects farther away from the eye than farClip
are not
drawn.
farClip
is specified as a value greater than nearClip
.
A value less than or equal to nearClip
is treated as
nearClip
plus a very small positive number.getFarClip()
,
setFarClip(double)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.