Write a 3D Game in Java

The complete name for this JavaOne 2007 technical session was Write a 3D Game in the Java Programming Language in Less than 50 Minutes. This was not a hands on session but instead Erick Hellman spoke on his experience writing a 3D game in Java. In full disclosure Erik informed those present that he never before written a game, has basic knowledge of OpenGL, lacks artistic talent, and suffers from color blindness. He said, “I need a ruler to draw a stick figure,” but he reassured the audience that a ruler wasn’t required because game development is made simple in Java.

Erik presented a basic recipe for game development. The recommended tools of the trade include Blender for 3D modeling, Gimp for image manipulation, JOGL for OpenGL bindings, JInput for game control, Vectmath for Java 3D coordinates, and XMLBeans for loading and persistent the models.

The architecure of the game revolves around the scene graph. The scene graph is the core of modern games and everything builds around it. He also briefly touched on the core mathematical concepts of 3D graphics, which are matrix transformations such as rotate, scale, and translate. For those that didn’t do well in linear algebra, or don’t even know what that is, the speaker say that OpenGL abstracts most of these details and that what a game developer is concerned with is the graphics pipeline.

Erik also mentioned some good 3D model formats. Lightwave, 3D Studio Max is a closed formats but he also recommended Collada and X3D as open format alternatives. The speaker also described a bit the ideas and algorithms used for collision detection. The technique he used is to enclose the character in a virtual, invisbile, bounding box. Elements of the game, such as barriers, need to be outside ot the avatars bounding box. He also listed some common issues when developing a multiplayer game. These issues include latency, pocket loss, and cheating.

In summary, Erik listed the key components for a simple game. He assumed the audience that with a scene graph, model, navigation, and collision detection any one there could in fact write a 3D game in 50 minutes. Talk about rapid game development!

Technorati Tags: , , , ,

2 Responses to “Write a 3D Game in Java”

  • Ricky Clarkson Says:

    So how long did he spend assuring the audience that he could write a 3D game in less than 50 minutes?

    I’d rather see him write a game than assure me he can.

  • TechKnow Says:

    @Ricky – LOL, he spent 50 minutes assuring us that we could write a game in 50 minutes. Given the title of the session I thought he was going to write a game in 50 minutes!!!

Leave a Reply