Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 12 ■ 3D MoDel Design anD priMitives: Using JavaFX 9 shape3D Classes

Next, let’s open the createBoardGameNodes() method and add a .setDrawMode(DrawMode.LINE)
method call to each of the primitives, setting their rendering mode from solid geometry to wireframe
geometry so we can see their underlying construction. Your Java statements, which are highlighted in yellow
in Figure 12-12, should look like the following:


sphere.setDrawMode(DrawMode.LINE);
box.setDrawMode(DrawMode.LINE);
pole.setDrawMode(DrawMode.LINE);


Figure 12-12. Set the drawMode property to LINE for all primitives with a .setDrawMode(DrawMode.LINE)
method call


Figure 12-11. Zoom the camera object in 100 percent using .setTranslateZ(-500), and move it down with
.setTranslateY(-300)

Free download pdf