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

I am refining this code to get a better view of the game board and to fit it into the window better so that
when we spin it in subsequent chapters on animation and gameplay, it will perfectly fit into the scene in any
spin orientation as well as while it is animating a random spin to select a topic quadrant.
The next thing I’m going to do is “tweak” the camera values in onStart() to fit the game board in the
window. As you can see in Figure 14-29, we need to flatten the camera view (30 degrees) and adjust the X, Y,
Z location slightly.


As you can see in Figure 14-30, I tweaked the rotation to 30°, the Z to 500 , the Y to -300, and the X to -260.

Figure 14-29. The game board is almost fitting perfectly in the window; let’s adjust the camera angle and
spacing next!


Figure 14-30. Set the camera rotation at 30 degrees, the Z location to 500, the Y location to -300, and the X
location to -260

Free download pdf