Skip to main content

OpenGL ES: Going 3D

  • Chapter
Beginning Android Games
  • 1936 Accesses

Abstract

Super Jumper worked out rather well with our 2D OpenGL ES rendering engine. Now it’s time to go full 3D. We actually already worked in a 3D space when we defined our view frustum and the vertices of our sprites. In the latter case the z-coordinate of each vertex was simply set to zero by default. The difference from 2D rendering isn’t all that big, really:

  • • Vertices not only have x- and y-coordinates, but also a z-coordinate.

  • • Instead of an orthographic projection, we use a perspective projection. Objects further away from the camera will appear smaller.

  • • Transformations, such as rotations, translations, and scales, have more degrees of freedom in 3D. Instead of just moving the vertices in the x-y plane we can now move them around freely on all 3 axes.

  • • We can define a camera with an arbitrary position and orientation in 3D space.

  • • The order we render the triangles of our objects with is now important. Objects further away from the camera must be overlapped by objects closer to the camera. The best thing is that we have already laid the groundwork for all of this in our framework. We just need to adjust a couple classes slightly to go 3D.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 39.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Mario Zechner

About this chapter

Cite this chapter

Zechner, M. (2011). OpenGL ES: Going 3D. In: Beginning Android Games. Apress. https://doi.org/10.1007/978-1-4302-3043-4_10

Download citation

Publish with us

Policies and ethics