Skip to main content

Introduction to 3D Graphics and Games

  • Chapter
  • First Online:
Java Game Development with LibGDX

Abstract

This chapter will introduce some of the 3D graphics capabilities of LibGDX. Along the way, you’ll learn about the concepts and classes necessary to describe and render a three-dimensional scene. To simplify and streamline this process, you’ll both adapt some old classes and write some new classes to accomplish the various tasks involved. Next, to understand 3D movement, you’ll create a simple interactive demo that enables players to control both an object within the scene and the camera viewing the scene. Finally, you’ll create the game Starfish Collector 3D, shown in Figure 16-1, which once again features a turtle on a quest to collect all the starfish that it can. For simplicity, this game will actually use 2.5D techniques: the game will render three-dimensional graphics, while the underlying gameplay (movement and collisions) will occur in two dimensions.

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

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.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

Notes

  1. 1.

    For additional information, two excellent books about the mathematical details of 3D graphics are 3D Math Primer for Graphics and Game Development by Fletcher Dunn and Ian Parberry (A K Peters/CRC Press, 2011) and Mathematics for 3D Game Programming and Computer Graphics by Eric Lengyel (Cengage Learning PTR, 2011).

  2. 2.

    When using three values to represent the rotations of an object around three axes, gimbal lock refers to the problem that occurs when an object is in one of a few particular orientations and two axes of rotation line up, making it impossible for the object to rotate in certain ways while in the given orientation.

  3. 3.

    In theory, this choice of the y-axis as the “up” direction is somewhat arbitrary, as you could orient yourself in the game world so that any axis corresponds to the up direction.

  4. 4.

    The amount of rotation around the upward-pointing axis is also called the yaw angle . Similarly, the rotation around the sideways-pointing axis (the motion from tilting your head up and down) is called the pitch angle , and the rotation around the forward-pointing axis (the motion from tilting your head to the left and to the right) is called the roll angle .

  5. 5.

    Technically, a sphere has only one radius value; the figures created by the createSphere method are more accurately referred to as ellipsoids . However, in the class you are creating, all the radius values will be set to the same number, so it truly is a spherical object.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Lee Stemkoski

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Stemkoski, L. (2018). Introduction to 3D Graphics and Games. In: Java Game Development with LibGDX. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3324-5_16

Download citation

Publish with us

Policies and ethics