Drawing 3D graphics and lighting up the scene with the OpenGL ES 1.x API

This recipe covers how to draw 3D objects, handle touch events, and lighten up the objects in OpenGL ES.

Getting ready

Readers are recommended to read the introduction and the Drawing 2D Graphics and Apply Transforms with OpenGL ES 1.x API recipies below before going through this one.

How to do it...

The following steps show how to develop our sample Android project:

  1. Create an Android application named CubeG1. Set the package name as cookbook.chapter4.gl1x. Please refer to the Loading native libraries and registering native methods recipe in Chapter 2, Java Native Interface, if you want more detailed instructions.
  2. Right-click on the project CubeG1, select Android Tools | Add Native ...

Get Android Native Development Kit Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.