June 2013
Intermediate to advanced
346 pages
8h 42m
English
It will be easier to understand the effects of the w component if we actually see it in action, so let’s add it to our table vertex data and see what happens. Since we’ll now be specifying the x, y, z, and w components of a position, let’s begin by updating POSITION_COMPONENT_COUNT as follows:
| AirHockey3D/src/com/airhockey/android/AirHockeyRenderer.java | |
| | private static final int POSITION_COMPONENT_COUNT = 4; |
We must always make sure that we’re giving OpenGL the right component count for everything that we use; otherwise we’ll either have a corrupt screen, nothing will display at all, or we might even crash our application.
The next step is to update all of our vertices:
| AirHockey3D/src/com/airhockey/android/AirHockeyRenderer.java ... |
Read now
Unlock full access