Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 14 ■ 3D MoDel hierarChy Creation: Using priMitives to Create a gaMe BoarD


Before we can see these new objects rendered in the 3D Scene, we’ll need to add them to the
SceneGraph hierarchy in your addNodesToSceneGraph() method body. Add the Q1S2 through Q1S5 Box
objects to the Q1 Group object, as highlighted in yellow and light blue in Figure 14-17.


Let’s also finish the second level (Q2 through Q4 branch nodes) of the SceneGraph hierarchy and add
the q2 through q4 Box planar primitives to the other three Q2 through Q4 Group nodes to add the interior
quadrants for the game board to the SceneGraph hierarchy. We’re doing this at this point in the work process
so that we will be able to work on the center portion of the game board since we are building it one quadrant
at a time.
Since we are basically finished with the first quadrant, we are putting the other three into the
SceneGraph so they will render (be visible) as we build out the rest of the game board quadrants and their
game board squares, which will attach to them around the perimeter of each respective quadrant.


Figure 14-16. Copy and paste the Q1S1 statements four times underneath themselves and reconfigure their
method calls


Figure 14-17. Add your other three Q2 to Q4 Group objects to the gameBoard Group and the other four
squares to Q1

Free download pdf