June 2013
Intermediate to advanced
346 pages
8h 42m
English
We now have everything in place, so let’s run the app to see what happens. You might be surprised to find that the terrain doesn’t show up at all! Let’s take a look at onDrawFrame to see what might be going on:
| Heightmap/src/com/particles/android/ParticlesRenderer.java | |
| | glClear(GL_COLOR_BUFFER_BIT); |
| | drawHeightmap(); |
| | drawSkybox(); |
| | drawParticles(); |
We first draw the height map, but then we draw the skybox right after, obliterating everything that was there before. Switch the two draw calls so that the skybox is drawn first and the height map is drawn second, and see what happens.
The terrain should now show up, but you’ll likely see some strange artifacts, as seen in Figure 60, Terrain with strange artifacts. The reason ...
Read now
Unlock full access