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, use a Run ➤ Project work process and again view your primitives individually. As you can see,
in Figure 12-10, the .setRotate() method is now using the z-axis for its rotation, so your 3D object is now
rendering as a 3D object, and you can see the shading (color or lightness difference on the different faces).


Figure 12-9. Add a .setRotationAxis() method call off box after the box.setTranslateX(500); and set it to
Rotate.X_AXIS


Figure 12-10. Now all primitives are oriented in such a way that their default light gray shading is visible in
the renderer

Free download pdf