In this part of the chapter, you will add many asteroids to the game world. These will be rotating with random speed around all three axes.
Due to an availability of the
Object3D class, adding a new model is quite simple. You just need to create a new class derived from the
Object3D class, write a part of code for suitable initialization of the object, and define a collection of colors suitable for the vertices. A few other changes are required in the
GameRenderer class, however, they are also straightforward and should not cause significant difficulties.
To start, you create a new class called
Asteroid. It represents a single asteroid placed in the game world. Data of all asteroids visible on the ...