Java 类javafx.scene.PerspectiveCamera 实例源码

项目:ExtremeGuiMakeover    文件:MovieApp.java   
private void showMasterDetailInWindow(final Stage stage, final Database database, final MasterDetailViewFeatures features) throws JAXBException, IOException {
    final Parent viewRoot = ViewFactory.createMasterDetailView(database, features);

    final Rectangle clip = new Rectangle();
    clip.setArcHeight(18);
    clip.setArcWidth(18);
    clip.widthProperty().bind(stage.widthProperty());
    clip.heightProperty().bind(stage.heightProperty());

    //TODO: Only clipping or PerspectiveCamera is working... :(
    features.customWindowClipProperty().addListener((obs, oldVal, newVal) -> {
        if (newVal) {
            viewRoot.setClip(clip);
        } else {
            viewRoot.setClip(null);
        }
    });

    final Scene scene = new Scene(viewRoot);

    features.useCssProperty().addListener((obs, oldVal, newVal) -> {
        updateStylesheets(scene, newVal);
    });

    updateStylesheets(scene, features.isUseCss());

    scene.setFill(Color.TRANSPARENT);
    scene.setCamera(new PerspectiveCamera());

    if (features.isCustomWindowUI()) {
        stage.initStyle(StageStyle.TRANSPARENT);
    }

    stage.setTitle("Movie Database");
    stage.setScene(scene);
    stage.setWidth(1100);
    stage.setHeight(720);
    stage.centerOnScreen();
    stage.show();

    final FeaturesDialog featuresDialog = new FeaturesDialog(stage);
    featuresDialog.addFeature(new Feature("Layout & Style", "demo2-css", features.useCssProperty()));
    featuresDialog.addFeature(new Feature("Image Background", "demo2-image-background",features.movieBackgroundProperty()));
    featuresDialog.addFeature(new Feature("List Animation", "demo2-list-animation",features.listAnimationProperty()));
    featuresDialog.addFeature(new Feature("List Shadow", "demo2-list-shadow",features.listShadowProperty()));
    // featuresDialog.addFeature(new Feature("List Cache", "demo2-list-cache",features.listCacheProperty()));
    featuresDialog.addFeature(new Feature("Poster Transform", "demo2-poster-transform",features.posterTransformProperty()));
    featuresDialog.addFeature(new Feature("Custom Window UI", "demo2-custom-window-ui",features.customWindowUIProperty()));
    featuresDialog.addFeature(new Feature("Custom Window Clip", "demo2-custom-window-clip", features.customWindowClipProperty()));
    featuresDialog.show();
}
项目:fxexperience2    文件:FlipTransition.java   
@Override
protected void interpolate(double d) {
    if (first) { // setup
        flipNode.setRotationAxis(Rotate.Y_AXIS);
        oldCamera = flipNode.getScene().getCamera();
        flipNode.getScene().setCamera(new PerspectiveCamera());
        first = false;
    }
    super.interpolate(d);
    if (d == 1) { // restore
        first = true;
        flipNode.setRotate(0);
        flipNode.setRotationAxis(Rotate.Z_AXIS);
        flipNode.getScene().setCamera(oldCamera);
    }
}
项目:Incubator    文件:Demo.java   
@Override
public void start(Stage stage) {        
    BorderPane pane = new BorderPane(flipPanel);
    pane.setPrefSize(400, 250);
    pane.setPadding(new Insets(50, 50, 50, 50));
    pane.setBackground(new Background(new BackgroundFill(Color.rgb(68, 68, 68), CornerRadii.EMPTY, Insets.EMPTY)));

    PerspectiveCamera camera = new PerspectiveCamera(false);
    camera.setFieldOfView(20);

    Scene scene = new Scene(pane);
    scene.setCamera(camera);
    scene.getStylesheets().add(Demo.class.getResource("styles.css").toExternalForm());

    stage.setTitle("FlipPanel Demo");
    stage.setScene(scene);
    stage.show();
}
项目:Gargoyle    文件:Drag3DObject.java   
private void loadCamera(Scene scene) {
    //initialize camera 
    camera = new PerspectiveCamera(true);
    camera.setVerticalFieldOfView(RUN_JASON);

    //setup camera transform for rotational support 
    cameraTransform.setTranslate(0, 0, 0);
    cameraTransform.getChildren().add(camera);
    camera.setNearClip(0.1);
    camera.setFarClip(100000.0);
    camera.setTranslateZ(-5000);
    cameraTransform.ry.setAngle(0.0);
    cameraTransform.rx.setAngle(-45.0);

    //add a Point Light for better viewing of the grid coordinate system 
    PointLight light = new PointLight(Color.GAINSBORO);
    cameraTransform.getChildren().add(light);
    cameraTransform.getChildren().add(new AmbientLight(Color.WHITE));
    light.setTranslateX(camera.getTranslateX());
    light.setTranslateY(camera.getTranslateY());
    light.setTranslateZ(camera.getTranslateZ());
    //attach camera to scene 
    scene.setCamera(camera);

}
项目:openjfx-8u-dev-tests    文件:SystemTestApp.java   
@Override
protected void initScene() {
    DefaultMeshBuilder dmb = new DefaultMeshBuilder() {

        @Override
        protected double function(double fx, double fy) {
            return 1;
        }
    };
    MeshView meshView = new MeshView(dmb.getTriangleMesh());
    meshView.setScaleX(100);
    meshView.setScaleY(100);
    meshView.setScaleZ(100);
    Sphere s = new Sphere(50);
    s.setTranslateX(WIDTH / 2);
    s.setTranslateY(HEIGHT / 2);
    Group root = new Group(s, meshView);
    scene = createScene(root, WIDTH, HEIGHT);
    scene.setCamera(new PerspectiveCamera());
}
项目:openjfx-8u-dev-tests    文件:LocalTo_TransformsApp.java   
public LocalTo_TransformsScene()
{
    super(hBox, 150, 150, true);
    setCamera(new PerspectiveCamera());

    StackPane firstPane = new StackPane();
    StackPane secondPane = new StackPane();
    StackPane thirdPane = new StackPane();
    StackPane nestedPane = new StackPane();
    StackPane doubleNestedPane = new StackPane();
    StackPane forthPane = new StackPane();

    Circle circle1 = CircleBuilder.create().radius(20).id("circle_one").build();
    Circle circle2 = CircleBuilder.create().radius(20).id("circle_two").build();
    Circle circle3 = CircleBuilder.create().radius(20).id("circle_three").build();
    Circle circle4 = CircleBuilder.create().radius(20).id("circle_four").translateZ(-50).build();

    forthPane.getChildren().add(circle4);
    doubleNestedPane.getChildren().add(circle3);
    nestedPane.getChildren().add(doubleNestedPane);
    thirdPane.getChildren().add(nestedPane);
    secondPane.getChildren().add(circle2);
    firstPane.getChildren().add(circle1);
    hBox.getChildren().addAll(firstPane, secondPane, thirdPane, forthPane);
}
项目:openjfx-8u-dev-tests    文件:Scene3D.java   
public Scene3D(Parent parent, double width, double height) {
//    super(new Group(parent), width, height, true);  // see http://javafx-jira.kenai.com/browse/RT-22696
    super(new Group(parent), width, height);


     if (true == Platform.isSupported(ConditionalFeature.SCENE3D)) {
         setCamera(new PerspectiveCamera());

         Translate centerTranslate = new Translate();
         centerTranslate.xProperty().bind(widthProperty().divide(2));
         centerTranslate.yProperty().bind(heightProperty().divide(2));

         getRoot().getTransforms().addAll(centerTranslate, translateZ, rotateX, rotateY, translateY);
       //  getRoot().setDepthTest(DepthTest.ENABLE);// see http://javafx-jira.kenai.com/browse/RT-22696
     }

 }
项目:mars-sim    文件:MarsViewer.java   
@Override
public void start(Stage stage) {
    Group group = buildScene();

    Scene scene = new Scene(
      new StackPane(group),
      VIEWPORT_SIZE, VIEWPORT_SIZE,
      true,
      SceneAntialiasing.BALANCED
    );

    scene.setFill(Color.rgb(10, 10, 40));

    scene.setCamera(new PerspectiveCamera());

    stage.setScene(scene);
    stage.show();

    stage.setFullScreen(true);

    rotateAroundYAxis(group).play();
}
项目:eavp    文件:FXCameraAttachmentTester.java   
/**
 * Check that the camera is added to the parent INode's JavaFX node
 * correctly.
 */
@Test
public void checkCamera() {

    // Create a camera, an attachment containing that camera, and the node
    Camera camera = new PerspectiveCamera();
    FXCameraAttachment attachment = new FXCameraAttachment(camera);
    GNode node = new GNode();
    Group fxNode = new Group();
    node.setProperty(INode.RENDERER_NODE_PROP, fxNode);

    // Check that the attachment has the camera
    assertTrue(attachment.getFxCamera() == camera);

    // Attach to the node and check that the camera has been added to the
    // JavaFX node
    attachment.attach(node);
    assertTrue(Util.getFxGroup(node).getChildren().contains(camera));

    // Detach from the node and check that the camera has been removed from
    // the JavaFX node.
    attachment.detach(node);
    assertFalse(Util.getFxGroup(node).getChildren().contains(camera));
}
项目:eavp    文件:FXViewer.java   
/**
 * <p>
 * Creates the current geometry editor camera.
 * </p>
 * 
 * @param parent
 *            the parent to create the camera on
 * 
 */
protected void createDefaultCamera(Group parent) {
    PerspectiveCamera perspCamera = new PerspectiveCamera(true);
    perspCamera.setNearClip(0.1);
    perspCamera.setFarClip(4000.0);
    perspCamera.setFieldOfView(35);
    perspCamera.setTranslateX(0);
    perspCamera.setTranslateY(0);

    parent.getChildren().add(perspCamera);

    // Hacked in camera (for now)
    FXCameraAttachment cameraAttachment = new FXCameraAttachment(
            perspCamera);
    setCamera(cameraAttachment);
}
项目:fr.xs.jtk    文件:Skybox.java   
public Skybox(Image topImg, Image bottomImg, Image leftImg, Image rightImg, Image frontImg, Image backImg, double size, PerspectiveCamera camera) {
    super();            
    this.imageType = SkyboxImageType.MULTIPLE;

    this.topImg = topImg;
    this.bottomImg = bottomImg;
    this.leftImg = leftImg;
    this.rightImg = rightImg;
    this.frontImg = frontImg;
    this.backImg = backImg;
    this.size.set(size);
    this.camera = camera;

    loadImageViews();

    getTransforms().add(affine);

    getChildren().addAll(views);

    startTimer();
}
项目:JVx.javafx    文件:FXAnimator.java   
/**
 * Calculates the angle needed for the given {@link Node} to be edge-on with
 * the user.
 * 
 * @param pNode the {@link Node}.
 * @param pOrientation the {@link Orientation}.
 * @return the angle needed for the {@link Node} the be viewed edge-on.
 */
public static double calculateEdgeAngle(Node pNode, Orientation pOrientation)
{
    Scene scene = pNode.getScene();
    Camera camera = scene.getCamera();

    if (camera instanceof PerspectiveCamera)
    {
        PerspectiveCamera perspectiveCamera = (PerspectiveCamera)camera;

        double distanceFromCenter = getDistanceFromCenter(scene, pNode, pOrientation);
        double rotationFromCenter = getAngleFromCenter(scene, perspectiveCamera, distanceFromCenter);
        return 90 - rotationFromCenter;
    }

    return 90;
}
项目:code-of-gotham    文件:StageUtil.java   
public Scene initScene(City city, PerspectiveCamera camera, String cityName) {
      Group root = new Group();
      buildCamera(root, camera);
      root.getTransforms().addAll(rxBox, ryBox, rzBox);
      subScene = new SubScene(root, SCENE_WIDTH, SCENE_HEIGHT, true, SceneAntialiasing.BALANCED);
      subScene.setCamera(camera);
      root.getChildren().add(city);

      // 2D
      BorderPane pane = new BorderPane();
      Pane toolBar = null;
try {
    toolBar = new CityToolBarService().load(cityName);
} catch (IOException e) {
    e.printStackTrace();
}
      pane.setBottom(subScene);
      pane.setTop(toolBar);

      Scene scene = new Scene(pane, SCENE_WIDTH, SCENE_HEIGHT);
      subScene.heightProperty().bind(scene.heightProperty());
      subScene.widthProperty().bind(scene.widthProperty());      
      return scene;
  }
项目:Equi    文件:SimpleGraphView3D.java   
public SimpleGraphView3D(boolean perspective) {
    super(new Group(), 800, 800, true, SceneAntialiasing.BALANCED);
    // root is dummy
    node3D = new Node3D();
    node3D.setTranslateX(400);
    node3D.setTranslateY(400);
    setRoot(node3D);
    setFill(Color.gray(0.95));
    if (perspective) {
        setCamera(new PerspectiveCamera());
    }

    MouseHandler3D handler = new MouseHandler3D(node3D);
    setOnMousePressed(handler);
    setOnMouseDragged(handler);
    setOnMouseReleased(handler);

    setOnScroll(new ZoomHandler3D(node3D));
}
项目:FXyzLib    文件:Drag3DObject.java   
private void loadCamera(Scene scene) {
    //initialize camera
    camera = new PerspectiveCamera(true);
    camera.setVerticalFieldOfView(RUN_JASON);

    //setup camera transform for rotational support
    cameraTransform.setTranslate(0, 0, 0);
    cameraTransform.getChildren().add(camera);
    camera.setNearClip(0.1);
    camera.setFarClip(100000.0);
    camera.setTranslateZ(-5000);
    cameraTransform.ry.setAngle(0.0);
    cameraTransform.rx.setAngle(-45.0);

    //add a Point Light for better viewing of the grid coordinate system
    PointLight light = new PointLight(Color.GAINSBORO);
    cameraTransform.getChildren().add(light);
    cameraTransform.getChildren().add(new AmbientLight(Color.WHITE));
    light.setTranslateX(camera.getTranslateX());
    light.setTranslateY(camera.getTranslateY());
    light.setTranslateZ(camera.getTranslateZ());
    //attach camera to scene
    scene.setCamera(camera);

}
项目:FXyzLib    文件:Skybox.java   
public Skybox(Image topImg, Image bottomImg, Image leftImg, Image rightImg, Image frontImg, Image backImg, double size, PerspectiveCamera camera) {
    super();            
    this.imageType = SkyboxImageType.MULTIPLE;

    this.topImg = topImg;
    this.bottomImg = bottomImg;
    this.leftImg = leftImg;
    this.rightImg = rightImg;
    this.frontImg = frontImg;
    this.backImg = backImg;
    this.size.set(size);
    this.camera = camera;

    loadImageViews();

    getTransforms().add(affine);

    getChildren().addAll(views);

    startTimer();
}
项目:PiOnWheels    文件:JFXScad.java   
@Override
public void start(Stage primaryStage) throws Exception {
    Parent main = loadFromFXML();

    Scene scene = new Scene(main, 1024, 768,true);

    scene.getStylesheets().add(JFXScad.class.getResource("java-keywords.css").
            toExternalForm());

    PerspectiveCamera camera = new PerspectiveCamera();

    scene.setCamera(camera);

    primaryStage.setTitle("JavaFXScad");
    primaryStage.setScene(scene);
    primaryStage.setMinWidth(1024);
    primaryStage.setMinHeight(768);
    primaryStage.show();
}
项目:javafxdemo    文件:Main.java   
@Override public void start(Stage stage) {        
    notifier = NotifierBuilder.create().build();

    Pane pane = new Pane();
    pane.getChildren().addAll(contentPane, prefPane, shadowOverlay);

    Scene scene = new Scene(pane, SIZE.getWidth(), SIZE.getHeight());
    scene.setCamera(new PerspectiveCamera());
    scene.getStylesheets().add(Main.class.getResource("styles.css").toExternalForm());
    registerListeners(scene);

    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();

    timer.start();
}
项目:incubator-netbeans    文件:Cube3D.java   
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 400, 150, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(400 / 2, 150 / 2),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
项目:incubator-netbeans    文件:CubeSystem3D.java   
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 500, 500, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(500 / 2, 500 / 2),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
项目:incubator-netbeans    文件:AudioVisualizer3D.java   
private void init(Stage primaryStage) {
    Group root = new Group();
    root.setDepthTest(DepthTest.ENABLE);
    primaryStage.setResizable(false);
    primaryStage.setScene(new Scene(root, 400, 500, true));
    primaryStage.getScene().setCamera(new PerspectiveCamera());
    root.getTransforms().addAll(
        new Translate(400 / 2, 500 / 2 + 100),
        new Rotate(180, Rotate.X_AXIS)
    );
    root.getChildren().add(create3dContent());
}
项目:fxexperience2    文件:FlipInYTransition.java   
@Override
protected void starting() {
    super.starting();
    node.setRotationAxis(Rotate.Y_AXIS);
    oldCamera = node.getScene().getCamera();
    node.getScene().setCamera(new PerspectiveCamera());
}
项目:SmartCity-ParkingManagement    文件:Curbstone3D.java   
@Override
public void start(final Stage s) throws Exception {
    s.setTitle("Curbstone 3D");
    final Curbstone c = new Curbstone(50, Color.web("#DC143C"), 1);
    c.setTranslateX(0);
    c.rx.setAngle(25);
    c.ry.setAngle(45);

    final Timeline animation = new Timeline();
    animation.getKeyFrames().addAll(new KeyFrame(Duration.ZERO, new KeyValue(c.ry.angleProperty(), 0d)),
            new KeyFrame(Duration.valueOf("20000ms"), new KeyValue(c.ry.angleProperty(), 360d)));
    animation.setCycleCount(Animation.INDEFINITE);
    // create root group
    final Parent root = c;
    // translate and rotate group so that origin is center and +Y is up
    root.setTranslateX(200);
    root.setTranslateY(75);
    final Line line = new Line(200, 200, 200, 200);
    final Rotate rotation = new Rotate(1, Rotate.Y_AXIS);
    rotation.pivotXProperty().bind(line.startXProperty());
    rotation.pivotYProperty().bind(line.startYProperty());
    root.getTransforms().add(rotation);
    // create scene
    final Scene scene = new Scene(root, 400, 150);
    scene.setCamera(new PerspectiveCamera());
    s.setScene(scene);
    s.show();
    // start spining animation
    animation.play();
}
项目:openjfx-8u-dev-tests    文件:PerspectiveCameraFixedEyeAsChildTestApp.java   
@Override
protected Camera addCamera(Scene scene) {
    camera = cam = new PerspectiveCamera(true);
    scene.setCamera(camera);
    camera.setFarClip(10000);
    return camera;
}
项目:openjfx-8u-dev-tests    文件:PerspectiveCameraFixedEyeIsolateTestApp.java   
@Override
protected Camera addCamera(Scene scene) {
    camera = cam = new PerspectiveCamera(true);
    scene.setCamera(camera);
    camera.setFarClip(10000);
    return camera;
}
项目:openjfx-8u-dev-tests    文件:PerspectiveCameraAsChildTestApp.java   
@Override
public void cameraConstruct() {
    Group parent = (Group) camera.getParent();
    parent.getChildren().remove(camera);
    camera = cam = new PerspectiveCamera();
    scene.setCamera(camera);
    parent.getChildren().add(camera);
}
项目:openjfx-8u-dev-tests    文件:SubSceneDepthTestApp.java   
@Override
protected SubScene getTopLeftScene() {
    rootTLMV = buildGroupMover();
    SubScene ss = new SubScene(rootTLMV.getGroup(), SS_WIDTH, SS_HEIGHT, true, SceneAntialiasing.DISABLED);
    ss.setCamera(new PerspectiveCamera());
    return ss;
}
项目:openjfx-8u-dev-tests    文件:SubSceneDepthTestApp.java   
@Override
protected SubScene getTopRightScene() {
    rootTRMV = buildGroupMover();
    rootTRMV.setRotateY(60);

    SubScene ss = new SubScene(rootTRMV.getGroup(), SS_WIDTH, SS_HEIGHT, true, SceneAntialiasing.DISABLED);
    ss.setCamera(new PerspectiveCamera());
    return ss;
}
项目:openjfx-8u-dev-tests    文件:SubSceneDepthTestApp.java   
@Override
protected SubScene getDownLeftScene() {
    rootDLMV = buildGroupMover();
    rootDLMV.setRotateY(-60);
    SubScene ss = new SubScene(rootDLMV.getGroup(), SS_WIDTH, SS_HEIGHT, true, SceneAntialiasing.DISABLED);
    ss.setCamera(new PerspectiveCamera());
    return ss;
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeIsolateTestApp.java   
@Override
protected Camera addCamera(SubScene scene) {
    PerspectiveCamera pc = new PerspectiveCamera(true);
    scene.setCamera(pc);
    pc.setFarClip(10000);
    return pc;
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeIsolateTestApp.java   
@Override
public void setFieldOfView(double d) {
    for (int i = 0; i < scenesCount; i++) {
        ((PerspectiveCamera) cameras[i]).setFieldOfView(d);
    }
    checkFieldOfView();
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeIsolateTestApp.java   
@Override
public void setVerticalFieldOfView(boolean bln) {
    for (int i = 0; i < scenesCount; i++) {
        ((PerspectiveCamera) cameras[i]).setVerticalFieldOfView(bln);
    }
    checkVerticalFieldOfView();
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeIsolateTestApp.java   
private void checkFieldOfView() {
    Assert.assertEquals(FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[0]).getFieldOfView(),
            ((PerspectiveCamera) cameras[1]).getFieldOfView(), delta);
    Assert.assertEquals(FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[2]).getFieldOfView(),
            ((PerspectiveCamera) cameras[1]).getFieldOfView(), delta);
    Assert.assertEquals(FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[0]).getFieldOfView(),
            ((PerspectiveCamera) cameras[2]).getFieldOfView(), delta);
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeIsolateTestApp.java   
private void checkVerticalFieldOfView() {
    Assert.assertEquals(VERTICAL_FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[0]).isVerticalFieldOfView(),
            ((PerspectiveCamera) cameras[1]).isVerticalFieldOfView());
    Assert.assertEquals(VERTICAL_FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[2]).isVerticalFieldOfView(),
            ((PerspectiveCamera) cameras[1]).isVerticalFieldOfView());
    Assert.assertEquals(VERTICAL_FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[0]).isVerticalFieldOfView(),
            ((PerspectiveCamera) cameras[2]).isVerticalFieldOfView());
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeAsChildTestApp.java   
@Override
protected Camera addCamera(SubScene scene) {
    PerspectiveCamera pc = new PerspectiveCamera(true);
    scene.setCamera(pc);
    pc.setFarClip(10000);
    return pc;
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeAsChildTestApp.java   
@Override
public void setFieldOfView(double d) {
    for (int i = 0; i < scenesCount; i++) {
        ((PerspectiveCamera) cameras[i]).setFieldOfView(d);
    }
    checkFieldOfView();
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeAsChildTestApp.java   
@Override
public void setVerticalFieldOfView(boolean bln) {
    for (int i = 0; i < scenesCount; i++) {
        ((PerspectiveCamera) cameras[i]).setVerticalFieldOfView(bln);
    }
    checkVerticalFieldOfView();
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeAsChildTestApp.java   
private void checkFieldOfView() {
    Assert.assertEquals(FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[0]).getFieldOfView(),
            ((PerspectiveCamera) cameras[1]).getFieldOfView(), delta);
    Assert.assertEquals(FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[2]).getFieldOfView(),
            ((PerspectiveCamera) cameras[1]).getFieldOfView(), delta);
    Assert.assertEquals(FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[0]).getFieldOfView(),
            ((PerspectiveCamera) cameras[2]).getFieldOfView(), delta);
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraFixedEyeAsChildTestApp.java   
private void checkVerticalFieldOfView() {
    Assert.assertEquals(VERTICAL_FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[0]).isVerticalFieldOfView(),
            ((PerspectiveCamera) cameras[1]).isVerticalFieldOfView());
    Assert.assertEquals(VERTICAL_FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[2]).isVerticalFieldOfView(),
            ((PerspectiveCamera) cameras[1]).isVerticalFieldOfView());
    Assert.assertEquals(VERTICAL_FIELD_OF_VIEW_DIFFERS,
            ((PerspectiveCamera) cameras[0]).isVerticalFieldOfView(),
            ((PerspectiveCamera) cameras[2]).isVerticalFieldOfView());
}
项目:openjfx-8u-dev-tests    文件:SubScenePerspectiveCameraAsChildTestApp.java   
@Override
public void cameraConstruct() {
    for (int i = 0; i < scenesCount; i++) {
        Group parent = (Group) cameras[i].getParent();
        parent.getChildren().remove(cameras[i]);
        cameras[i] = new PerspectiveCamera();
        subScenes[i].setCamera(cameras[i]);
        parent.getChildren().add(cameras[i]);
    }
}