3D Model Hierarchy Creation: Using Primitives to Create a Game Board

Wallace Jackson · Apress eBooks · 2017

Now that you have learned how to “skin” your 3D primitives using the JavaFX Phong shader algorithms and their various color and effects mapping channels and you have created colorful, highly optimized game board square texture maps, it’s time to add some more custom methods for building the game board and setting up the Phong shader objects with the texture maps. We’ll need to create a createGameBoardNodes() method to organize the 3D primitive assets that comprise our 3D game, as the createBoardGameNodes should (and does) contain higher-level Node subobject instantiation and configuration, such as the Scene, Root, UI StackPane, 3D gameBoard Group, Camera, and Lighting, as well as four game board Quadrant Group objects named Q1 through Q4 (quadrants 1 through 4). We will also create the other 19 game board square objects, named Q1S1 through Q1S5, Q2S1 through Q2S5, Q3S1 through Q3S5, and Q4S1 through Q4S5 to keep object names short. Naming the objects the abbreviated version of Quadrant1Square1 (Q1S1) will make the Java code that uses these abbreviated terms much more readable.

Read the paper · More papers on PaperTik