- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Camera
-
- javafx.scene.PerspectiveCamera
-
- All Implemented Interfaces:
-
Styleable
,EventTarget
public class PerspectiveCamera extends Camera
指定用于渲染场景的透视相机。该相机定义了透视投影的观看体积; 一个截断的右金字塔。
fieldOfView
值可用于更改观看音量。 默认情况下,本相机位于场景的中心,并沿z轴正方向。 由本相机定义的坐标系起源于面板的左上角,Y轴指向下方,Z轴指向观察者(进入屏幕)。 如果将PerspectiveCamera
节点添加到场景图中,则相机的变换位置和方向将定义相机的位置和相机所在的方向。在默认摄像机中,如果固定的EyeAtCameraZero为假,则在Z中调整眼睛位置的Z值,使得使用指定的
fieldOfView
生成的投影矩阵将在与设备无关的像素中产生Z = 0(投影平面)的单位,匹配ParallelCamera的。 当场景调整大小时,投影平面(Z = 0)场景中的物体将保持相同的大小,但是场景的内容更多或更少是可见的。如果fixedEyeAtCameraZero为真,则眼睛位置固定在摄像机的本地坐标中的(0,0,0)。 使用指定的
fieldOfView
生成投影矩阵,并将投影体积映射到视口(窗口),使其在投影平面上的多个或更少的与设备无关的像素上展开。 当场景调整大小时,场景中的对象将按比例缩小或增长,但内容的可见部分不变。如果要转换(移动)相机,我们建议将fixedEyeAtCameraZero设置为true。 当固定EyeAtCameraZero设置为false时转换相机可能会导致不直观的结果。
请注意,这是一个条件功能。 有关详细信息,请参阅
ConditionalFeature.SCENE3D
。- 从以下版本开始:
- JavaFX 2.0
-
-
Property Summary
Properties Type Property 描述 DoubleProperty
fieldOfView
指定相机投影的视野角度,以度为单位。BooleanProperty
verticalFieldOfView
定义fieldOfView
属性是否适用于投影的垂直维度。-
Properties inherited from class javafx.scene.Node
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, viewOrder, visible
-
-
Field Summary
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
-
构造方法摘要
构造方法 Constructor 描述 PerspectiveCamera()
创建PerspectiveCamera的空实例。PerspectiveCamera(boolean fixedEyeAtCameraZero)
用指定的fixedEyeAtCameraZero标志构建PerspectiveCamera。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 DoubleProperty
fieldOfViewProperty()
指定相机投影的视野角度,以度为单位。double
getFieldOfView()
获取属性fieldOfView的值。boolean
isFixedEyeAtCameraZero()
返回一个标志,指示本相机是否在相机原点使用固定的眼睛位置。boolean
isVerticalFieldOfView()
获取属性verticalFieldOfView的值。void
setFieldOfView(double value)
设置属性fieldOfView的值。void
setVerticalFieldOfView(boolean value)
设置属性verticalFieldOfView的值。BooleanProperty
verticalFieldOfViewProperty()
定义fieldOfView
属性是否适用于投影的垂直维度。-
Methods inherited from class javafx.scene.Camera
farClipProperty, getFarClip, getNearClip, nearClipProperty, setFarClip, setNearClip
-
Methods inherited from class javafx.scene.Node
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, getInitialCursor, getInitialFocusTraversable, 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, getViewOrder, 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, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
-
-
-
Property Detail
-
fieldOfView
public final DoubleProperty fieldOfViewProperty
指定相机投影的视野角度,以度为单位。- Default value:
- 30.0
- 另请参见:
-
getFieldOfView()
,setFieldOfView(double)
-
verticalFieldOfView
public final BooleanProperty verticalFieldOfViewProperty
定义fieldOfView
属性是否适用于投影的垂直维度。 如果为假,则fieldOfView
将适用于投影的水平维度。- Default value:
- 真正
- 从以下版本开始:
- JavaFX 8.0
- 另请参见:
-
isVerticalFieldOfView()
,setVerticalFieldOfView(boolean)
-
-
构造方法详细信息
-
PerspectiveCamera
public PerspectiveCamera()
创建PerspectiveCamera的空实例。
-
PerspectiveCamera
public PerspectiveCamera(boolean fixedEyeAtCameraZero)
用指定的fixedEyeAtCameraZero标志构建PerspectiveCamera。在默认摄像机中,在固定的EyeAtCameraZero为假的情况下,在Z中调整眼睛位置的Z值,使得使用指定的
fieldOfView
生成的投影矩阵将在与设备无关的像素中产生Z = 0(投影平面)匹配ParallelCamera的。 当场景调整大小时,投影平面(Z = 0)场景中的物体将保持相同的大小,但是场景的内容更多或更少是可见的。如果fixedEyeAtCameraZero为真,则眼睛位置固定在摄像机的本地坐标中的(0,0,0)。 使用指定的
fieldOfView
生成投影矩阵,并将投影体积映射到视口(窗口),使其在投影平面上的多个或更少的与设备无关的像素上展开。 当场景调整大小时,场景中的对象将按比例缩小或增长,但内容的可见部分不变。如果要转换(移动)相机,我们建议将fixedEyeAtCameraZero设置为true。 当固定EyeAtCameraZero设置为false时转换相机可能会导致不直观的结果。
- 参数
-
fixedEyeAtCameraZero
- 如果眼睛位置固定在摄像机的本地坐标中的(0,0,0),fixedEyeAtCameraZero
真。 - 从以下版本开始:
- JavaFX 8.0
-
-
方法详细信息
-
setFieldOfView
public final void setFieldOfView(double value)
设置属性fieldOfView的值。- Property description:
- 指定相机投影的视野角度,以度为单位。
- Default value:
- 30.0
-
getFieldOfView
public final double getFieldOfView()
获取属性fieldOfView的值。- Property description:
- 指定相机投影的视野角度,以度为单位。
- Default value:
- 30.0
-
fieldOfViewProperty
public final DoubleProperty fieldOfViewProperty()
指定相机投影的视野角度,以度为单位。- Default value:
- 30.0
- 另请参见:
-
getFieldOfView()
,setFieldOfView(double)
-
setVerticalFieldOfView
public final void setVerticalFieldOfView(boolean value)
设置属性verticalFieldOfView的值。- Property description:
-
定义
fieldOfView
属性是否适用于投影的垂直维度。 如果是假的,则fieldOfView
将适用于投影的水平维度。 - Default value:
- 真正
- 从以下版本开始:
- JavaFX 8.0
-
isVerticalFieldOfView
public final boolean isVerticalFieldOfView()
获取属性verticalFieldOfView的值。- Property description:
-
定义
fieldOfView
属性是否适用于投影的垂直维度。 如果为假,则fieldOfView
将适用于投影的水平尺寸。 - Default value:
- 真正
- 从以下版本开始:
- JavaFX 8.0
-
verticalFieldOfViewProperty
public final BooleanProperty verticalFieldOfViewProperty()
定义fieldOfView
属性是否适用于投影的垂直维度。 如果为假,则fieldOfView
将适用于投影的水平维度。- Default value:
- 真正
- 从以下版本开始:
- JavaFX 8.0
- 另请参见:
-
isVerticalFieldOfView()
,setVerticalFieldOfView(boolean)
-
isFixedEyeAtCameraZero
public final boolean isFixedEyeAtCameraZero()
返回一个标志,指示本相机是否在相机原点使用固定的眼睛位置。 如果fixedEyeAtCameraZero
为true
,则在摄像机的本地坐标中,眼睛位置固定为(0,0,0)。 这个属性是不可变的。- 结果
- 指示该相机是否在相机原点处使用固定眼睛位置的标志
- 从以下版本开始:
- JavaFX 8.0
-
-