In Chapter 5, Introducing 3D Custom Views, we saw how to create a very simple rotating cube using OpenGL ES. Starting from that example and by just adding a way to react to user interactions, we can create the foundations of a more complex and interactive custom view.
Creating an interactive 3D custom view
Adding interactions
Let's start by using the code from the Example25-GLDrawing. Processing user interactions is quite simple, as we have already seen in our previous examples. We don't have to do anything different than before, just override the onTouchEvent() method in our class extending GLSurfaceView and react properly to the different MotionEvents we will receive. For instance, if we don't return true...