Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 11 ■ 3D SCene Configuration: uSing the perSpeCtiveCamera anD pointLight


Next, let’s use the Run ➤ Project work process to see how the new 3D Scene you have created by adding
a PerspectiveCamera is affecting your existing 2D UI design; this is now a “hybrid” 2D and 3D application,
which is the most advanced type of JavaFX application. This is true because we need to combine 2D and
3D assets in one seamless compositing environment, which is an extremely complicated undertaking. Two
of the most advanced film and special effects compositing software packages available, Fusion and Nuke,
accomplish this fusion of 2D with 3D. In fact, if you want to learn more about combining 2D and 3D assets
into one pipeline, check out VFX Fundamentals (Apress, 2016). As you can see in Figure 11-2, the StackPane
branch of your SceneGraph root, and everything underneath it, is being carried (correctly) with it and is now
referencing (visually) from PerspectiveCamera at the top of the hierarchy and its 0,0,0 center of the screen
that you learned about earlier in the chapter.


Figure 11-1. Add a PerspectiveCamera object declaration at the top of the class and then instantiate it and
configure it

Free download pdf