This content has been marked as final. Show 7 replies
Hi. Take a look at the new javafx8 container: javafx.scene.SubScene
Now what do I do with this? Do I add it to a stage? Can you have multiple scenes per stage?
Edited by: KonradZuse on Mar 13, 2013 3:01 PM
Anything? I aslo am curious how we exactly work mouse events... I have a Box, inside a Group, inside a scene. I would think the mouse events would register via the group, but only seems to work with the scene... I've been having lots of issues tho >(
Edited by: KonradZuse on Mar 15, 2013 12:04 PM
A SubScene has some similar properties to a Scene - in particular a Camera, but it's a subclass of Node, not of Scene. So you cannot use a SubScene as the Scene in a Stage, but you can add it as a child to other parent nodes. Thus, as I undersatand it, you can effectively have multiple SubScenes per Stage with something like
HBox root = new HBox(); SubScene sscene1 = new SubScene(); sscene1.setCamera(new PerspectiveCamera()); sscene1.setDepthTest(DepthTest.ENABLE); SubScene sscene2 = new SubScene(); sscene2.setCamera(new ParallelCamera()); root.getChildren().addAll(sscene1, sscene2); Scene scene = new Scene(root, 800, 600, true); primaryStage.setScene(scene);
Yeah that isn't confusing terminology or anything :p.
Thanks james_D I appreciate it! So instead of using multiple groups, we use 1 group with multiple "subscenes" in it...?
Also by looking at your code you throw up 2 cams, how exactly does the computer look at each cam? Is it individually looked at as if we were a security guard looking at a bunch of security cams on the screen, or does it all work together in some craziness? :P
Also how does each individual cam with against the SCENE cam? Does SCENE take priority or, does it all work together? :p
Edited by: KonradZuse on Mar 15, 2013 12:10 PM
I haven't tried it (yet); probably won't for a little while. (I'm kind of waiting for the Shape3D stuff to be available on the Mac before I experiment with most of the new features.)1 person found this helpful
I recommend you try it and see how it plays out...
Yeah I understand, the beta builds for 3D are having some issues, and it's all still coming together, but it's very good thus far, just some tweaks, and bug fixes needed :)
I'll try it out and report back to you!
One last thing, I remember reading somewhere that you can set the FX Window to change the child nodes when resized. I notice sometimes you can shrink/enlarge objects to fit the screen 100% of the time, and not to clip out areas, but I also notice with a camera that if you have a 3D object that when resized will change "perspective." Which I noticed is from the PerspectiveCamera, and I see you used a ParallelCam in your example, does that just stay forward? Are these connected in some way(and are there other "tasks" that you can do with the resizing of the window)? I will have to check again in the tutorials, but I know there was mention of things that happen during resize.