# The Scene Graph and Other jME3 Terminology

Before you start making games, make sure you understand general 3D Gaming terminology.

Second, if you are a beginner, we recommend our Scene Graph for Dummies presentation for a visual introduction to the concept of a scene graph.

Then continue learning about jME3 concepts here.

## Coordinate System

The jMonkeyEngine uses a right-handed coordinate system, just as OpenGL does.

The coordinate system consists of:

- The origin, a single point in space.
  - This point is always at coordinate (0,0,0)
- Three coordinate axes that are mutually perpendicular, and meet in the origin.
  - The X axis is "right/left"
  - The Y axis is "up/down"
  - The Z axis is "towards you/away from you"

Every point in 3D space is defined by its (x,y,z) coordinates. The data type for vectors is com.jme3.math.Vector3f.

For your orientation, the default camera's location is (0.0f,0.0f,10.0f), and it is looking in the direction described by the unit vector (0.0f, 0.0f, -1.0f). This means your point of view is on the positive side of the Z axis, looking towards the origin, down the Z axis.

The unit of meassurement is `world unit` (wu). Typically, 1 wu is considered to be one meter. All scales, vectors and points are relative to this coordinate system.

## Scene Graph and RootNode

The scene graph represents your 3D world. Objects in the jME3 scene graph are called Spatials. Everything attached to the rootNode is part of the scene graph. Attaching a Spatial to the rootNode (or other nodes) adds the Spatial to the scene; detaching removes it.

## Spatials: Node vs Geometry

A Spatial can be transformed, loaded and saved. There are two types of Spatials, Nodes and Geometries.

| Spatial
Purpose: | A Spatial is an abstract data structure that stores transformations (translation, rotation, scale).
| Geometry | Node
Visibility: | A visible 3-D object. | An invisible "handle" for a group of objects.
Purpose: | Represents the "look" of an object: Shape, color, texture, opacity/transparency. | Groups Geometries and other Nodes together: You transform a Node to affect all attached Nodes.
Content: | Transformations, mesh, material. | Transformations. No mesh, no material.
Examples: | A box, a sphere, player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc??? | The rootNode, the guiNode, an audio node, a custom grouping node, etc.

## How to Use This Knowledge?

Before you start creating your game, you should plan your scene graph: Which Nodes and Geometries will you need? Complete the Hello World tutorial series to learn how to load and create Spatials, how to lay out a scene by attaching, detaching, and transforming Spatials, and how to add interaction and effects to a game.

The intermediate and advanced documentation gives you more details on how to put all the parts together to create an awesome 3D game in Java!

## See also

- Spatial ??? More details about working with Nodes and Geometries
- Traverse SceneGraph ??? Find any Node or Geometry in the scenegraph.

spatial, node, mesh, geometry, scenegraph, rootnode

view online version