This code will create a 3d scene that is 300x300 large. The viewport won't resize when I resize the containing window/stage.
Parent
doesn't have any width
or height
properties. How do I adjust the size of the Parent
and/or SubScene
to the changing window size?
bind it to the parent
SubScene subscene = new SubScene(root, 1024, 768, true, null);
subscene.setFill(Color.GREY);
subscene.setCamera(camera);
StackPane stackPane = new StackPane();
stackPane.getChildren().add(subscene);
subscene.heightProperty().bind(stackPane.heightProperty());
subscene.widthProperty().bind(stackPane.widthProperty());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With