3D Gameplay UI Creation: Using the Sphere Primitive to Create a UI Node
Wallace Jackson · Apress eBooks · 2017
Now that you have created the multitiered gameBoard Group Node (subclass) hierarchy and tested it to see whether it rotates as if it were one 3D model, it is time to add a Sphere 3D primitive so we can create a 3D user interface element for the user to use to create random “spins” during gameplay. We will also set up the Phong shader objects for these and again use GIMP 2.8.22 to create (from scratch) the rest of your diffuse texture maps for the game board quadrants, as well as a 3D “spinner” UI texture map for a Sphere primitive. This spinner will be used on each player’s turn to randomly spin the gameboard to select the topic category. You will always need to differentiate your pro Java 9 game from others out there, so we’ll be unique and spin the gameboard itself to pick the quadrant (topic category), which cannot be done with real-life game boards but which can be done with virtual i3D game boards. We’ll add Java 9 code to the top of your class as well as in the createMaterials(), addNodesToSceneGraph(), and loadImageAssets() method bodies. We’ll create custom PNG24 diffuse textures to add to your project source (/src) folder. We’ll rearrange your createGameBoardNodes() method to reorganize the quadrant 3D primitives that we’ll work on during this chapter to complete the interior parts of the game board design. We’ll place the quadrants together at the top of this method.