Simple3D – a simple way to play with Java 3D


Andrew Davison

Why Java 3D, and why Simple3D? Simple3D Pic

Invariably, the first reaction I receive when I mention that I'm coding in Java 3D is "I thought that was dead!". Fortunately, reports of its demise have been greatly exaggerated, although it was mostly abandoned by Sun (later Oracle) with the advent of JavaFX at the tail-end of the 2000s.

In the middle of 2012, Julien Gouesse announced on his blog that Java 3D was back, ported to JOGL 2.0, a cross-platform Java binding of OpenGL. The latest version (v.1.7) can be downloaded from here. For more details, see Part 1 in the left-hand column.

The next response is "But Java 3D is OLD!!", which is true of course. The "Getting Started with the Java 3D API" tutorial by Dennis J Bouvier for v 1.1 dates from 1999. However, there are many advantages to the API's age: numerous online materials, books, code examples, and a pleasing simplicity compared to many recent 3D APIs. Part 1 supplies some helpful links in that regard

If Java 3D is so wonderful, then why the need for Simple3D? Java 3D shares a major flaw with a lot of Java programs: reams and reams of boilerplate code which tends to obscure the important stuff. Simple3D hides almost all of this, which makes it much easier to appreciate (and use) Java 3D's core strength -- the scene graph. Simple3D also includes an ever-growing collection of static utility methods which reduce some of the API complexities that confuse new uses (e.g. the need for Transform3D and TransformGroup objects to specify transformations).

For example, the 3D scene in the above picture is created with the folowing program. This is a LOT less text than a plain Java 3D version.

My main aim with Simple3D is to make it easier and quicker to build simple 3D applications. In the coming months, I'll be employing it to code 3D turtle graphics, generate 3D curves and surfaces, produce 3D tiling, and more.