Exercises

As your first exercise, rotate your viewpoint slowly around the table by adding one single method call to onDrawFrame.

For a more challenging exercise, take a look at the following figure:

images/Objects/public-domain-air-hockey-table-with-mallet.jpg

How would you update the mallet generator to more closely approximate this type of mallet? You can still build the mallet out of simple geometric shapes. Here’s one way you might want to approach it:

  • Two regular cylinder sides: one for the handle, one for the outside of the base

  • Two rings: one for the top of the base and one for the inside of the base

  • One sloped cylinder side for the inside of the base to connect the two rings

  • A half-sphere to cap the ...

Get OpenGL ES 2 for Android 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.