Populating the scene

Now you know where you are, and how to position and transform 3D objects. When you start populating the scene, you face the issue of handling possibly hundreds of objects. In order to keep track of all your stuff, the jMonkeyEngine provides you with a special data structure—the scene graph. The scene graph manages all elements in a 3D scene. We call the elements in the 3D scene spatials.

Spatials are attached to one another in a parent-child relationship. When we speak of attaching a spatial, we mean that we add the spatial to the scene. When we speak of detaching a spatial, we remove it from the scene.

One specific parent spatial in every game is the root node of the scene. Every spatial that is attached to this one root node, ...

Get jMonkeyEngine 3.0 Beginner's Guide 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.