mitm001 5 лет назад
Родитель
Сommit
7e7a6b6b36

+ 155 - 0
docs/modules/ROOT/pages/jme3/the_scene_graph.adoc

@@ -0,0 +1,155 @@
+= The Scene Graph and Other jME3 Terminology
+:revnumber: 2.0
+:revdate: 2020/07/13
+:keywords: spatial, node, mesh, geometry, scenegraph, rootnode
+
+
+Before you start making games, make sure you understand general xref:tutorials:concepts/terminology.adoc[3D Graphics terminology].
+
+Second, if you are a beginner, we recommend our xref:tutorials:concepts/scenegraph_for_dummies.adoc[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
+
+[.right]
+image::tutorials:concepts/coordinate-system.png[coordinate-system.png,width="235",height="210",align="right"]
+
+
+The jMonkeyEngine uses a right-handed coordinate system, just as OpenGL does.
+
+The coordinate system consists of:
+
+*  The _origin_, a single central point in space.
+**  The origin point is always at coordinate zero, in Java: `new Vector3f(0,0,0)`.
+
+*  Three _coordinate axes_ that are mutually perpendicular, and meet in the origin.
+**  The X axis starts left and goes right.
+**  The Y axis starts below and goes up.
+**  The Z axis starts away from you, and goes towards you.
+
+
+Every point in 3D space is uniquely defined by its X,Y,Z coordinates. The three numeric coordinates express how many "`steps`" from each of the three axes a point is. The data type for all vectors in jME3 is `com.jme3.math.Vector3f`. All vectors are relative to the described coordinate system. +
+Example: The point `new Vector3f(3,-5,1)` is 3 steps to the right, 5 steps down, and 1 towards you.
+
+
+[NOTE]
+====
+The unit of meassurement ("`one`" step) in jME3 is the *world unit*, short: wu. Typically, 1 wu is considered to be one meter. As long as you are consistant throughout your game, 1 wu can be any distance you like.
+====
+
+
+For your orientation:
+
+*  The default camera's location is `Vector3f(0.0f, 0.0f, 10.0f)`.
+*  The default camera is looking in the direction described by the (so called) negative Z unit vector `Vector3f(0.0f, 0.0f, -1.0f)`.
+
+This means the player's point of view is on the positive side of the Z axis, looking back, towards the origin, down the Z axis.
+
+
+== How to move yourself through the 3D scene
+
+When you play a 3D game, you typically want to navigate the 3D scene. Note that by default, the mouse pointer is invisible, and the mouse is set up to control the camera rotation!
+
+By default, jME3 uses the following common navigation inputs
+[cols="3", options="header"]
+|===
+
+a| Game Inputs
+a| Camera Motion
+a| Player POV
+
+a|Press the W and S keys
+a|move the camera forward, and backward
+a|you walk back and forth
+
+a|Press the A and D keys
+a|move the camera left and right
+a|you step left or right
+
+a|Press the Q and Y keys
+a|move the camera up and down
+a|you fly up and down
+
+a|Move the mouse left-right
+a|rotate the camera left/right
+a|you look left or right
+
+a|Move the mouse forwards-backwards
+a|rotate up/down
+a|you look at the sky or your feet
+
+|===
+
+These default settings are called "`WASD`" keys and "`Mouse`" Look. You can customize xref:core:input/input_handling.adoc[input handling] for your game. Sorry, but these settings work best on a QWERTY/QWERTZ keyboard.
+
+
+== Scene Graph and RootNode
+
+The _scene graph_ represents your 3D world. Objects in the jME3 scene graph are called xref:jme3/advanced/spatial.adoc[Spatial]s. Everything attached to the parent _rootNode_ is part of your scene. Your game inherits the `rootNode` object from the `SimpleApplication` class.
+
+
+image::tutorials:concepts/scene-graph.png[scene-graph.png,width="",height="",align="center"]
+
+
+*  _Attaching_ a Spatial to the rootNode (or its child nodes) adds it to the scene;
+*  _Detaching_ a Spatial from the rootNode (or its child nodes) removes it from the scene.
+
+All objects in the scene graph are in a parent-child relationship. When you transform (move, rotate, scale) one parent, all its children follow.
+
+
+[NOTE]
+====
+The scene graph only manages the parent-child relationship of spatials. The actual location, rotation, or scale of an object is stored inside each Spatial.
+====
+
+
+
+== Spatials: Node vs Geometry
+
+A Spatial can be transformed (in other words, it has a location, a rotation, and a scale). A Spatial can be loaded and saved as a .3jo file. There are two types of Spatials, _Node_ and _Geometry_:
+[cols="10,45,45", options="header"]
+|===
+
+<a|
+2+a| Spatial
+
+a| Purpose:
+2+a| A Spatial is an abstract data structure that stores transformations (translation, rotation, scale).
+
+<a|
+a| Geometry
+a| Node
+
+a| Visibility:
+a| A visible 3-D object.
+a| An invisible "`handle`" for a group of objects.
+
+a| Purpose:
+a| A Geometry represents the "`look`" of an object: Shape, color, texture, opacity/transparency.
+a| A Node groups Geometries and other Nodes together: You transform a Node to affect all attached Nodes (parent-child relationship).
+
+a| Content:
+a| Transformations, mesh, material.
+a| Transformations. No mesh, no material.
+
+a| Examples:
+a| A box, a sphere, player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc…
+a| The rootNode, the guiNode, an audioNode, a custom grouping node for a vehicle plus its passengers, 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 xref:tutorials:beginner/beginner.adoc[Beginner tutorials] 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 <<jme3#documentation-for-intermediate-users#,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
+
+*  xref:jme3/advanced/spatial.adoc[Spatial] – More details about working with Nodes and Geometries
+*  xref:jme3/advanced/traverse_scenegraph.adoc[Traverse SceneGraph] – Find any Node or Geometry in the scenegraph.
+*  xref:jme3/advanced/camera.adoc[Camera] – Learn more about the Camera in the scene.

+ 1 - 1
docs/modules/core/pages/app/simpleapplication.adoc

@@ -173,7 +173,7 @@ a|Purpose
 
 a|rootNode +
 getRootNode()
-a|The root node of the scene graph. Attach a xref:jme3/advanced/spatial.adoc[Spatial] to the rootNode and it appears in the 3D scene.
+a|The root node of the scene graph. Attach a xref:scene/spatial.adoc[Spatial] to the rootNode and it appears in the 3D scene.
 
 a|guiNode +
 getGuiNode()

+ 1 - 1
docs/modules/core/pages/scene/3d_models.adoc

@@ -13,7 +13,7 @@ To use 3D models in a jME3 application:
 
 .  Export the 3D model using a xref:jme3/features.adoc#supported-external-file-types.adoc[Supported External File Type].
 .  Save the files into a sub-directory of your jME3 `Assets` directory.
-.  In your code, you use the xref:jme3/advanced/asset_manager.adoc[Asset Manager] to load models as xref:jme3/advanced/spatial.adoc[Spatial]s into a jME application.
+.  In your code, you use the xref:jme3/advanced/asset_manager.adoc[Asset Manager] to load models as xref:scene/spatial.adoc[Spatial]s into a jME application.
 +
 [source,java]
 ----

+ 1 - 1
docs/modules/sdk/pages/terrain_editor.adoc

@@ -122,7 +122,7 @@ Note that whenever you modify the height of the terrain, you should re-generate
 There are a few things your code needs to do to load the terrain.
 
 *  You must first use the asset manager to load the scene, see the xref:tutorials:beginner/hello_asset.adoc[hello asset tutorial].
-*  The terrain (as you can see on the left in the editor) is a sub-node of the scene, so you have to write code to investigate the child nodes of the scene until you find the node that is the terrain, see xref:ROOT:jme3/the_scene_graph.adoc[this tutorial for scene graph concepts].
+*  The terrain (as you can see on the left in the editor) is a sub-node of the scene, so you have to write code to investigate the child nodes of the scene until you find the node that is the terrain, see xref:tutorials:concepts/the_scene_graph.adoc[this tutorial for scene graph concepts].
 *  You also have to set the camera on the LOD control in order for it to work correctly:
 
 [source,java]

+ 1 - 0
docs/modules/tutorials/nav.adoc

@@ -22,6 +22,7 @@
 ** xref:concepts/rotate.adoc[3-D Rotation]
 ** xref:concepts/math_video_tutorials.adoc[Math video tutorial series]
 ** xref:concepts/multi-media_asset_pipeline.adoc[Multi-Media Asset Pipeline]
+** xref:concepts/the_scene_graph.adoc[The Scene Graph]
 ** xref:concepts/scenegraph_for_dummies.adoc[Scene Graph for Dummies]
 ** xref:concepts/terminology.adoc[3D Graphics Terminology]
 ** xref:concepts/transparency_sorting.adoc[Transparency Sorting]

+ 1 - 1
docs/modules/tutorials/pages/beginner/beginner.adoc

@@ -13,5 +13,5 @@ Note that Test apps in this example project are not necessarily the recommended
 image::beginner/beginner-physics.png[beginner-physics.png,width="360",height="291"]
 
 *  Get the source code at link:https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-examples/src/main/java/jme3test/helloworld[jme3-examples/src/main/java/jme3test/helloworld/].
-*  Make sure you are familiar with basic xref:concepts/terminology.adoc[3D game development concepts] such as xref:ROOT:jme3/the_scene_graph.adoc[the scene graph].
+*  Make sure you are familiar with basic xref:concepts/terminology.adoc[3D game development concepts] such as xref:concepts/the_scene_graph.adoc[the scene graph].
 *  If you need help, try searching the wiki (search box is at the top of every wiki page) or using the link:https://hub.jmonkeyengine.org/search?expanded=true[forum search]. If that doesn't work try asking on the link:https://hub.jmonkeyengine.org/[forum] itself, make sure you learn link:https://hub.jmonkeyengine.org/t/how-to-type-code-blocks/31155[how to use code blocks] before doing so.

+ 1 - 1
docs/modules/tutorials/pages/beginner/hello_node.adoc

@@ -7,7 +7,7 @@
 
 In this tutorial we will have a look at the creation of a 3D scene.
 
-*  This tutorial assumes that you know what xref:ROOT:jme3/the_scene_graph.adoc[the Scene Graph] is.
+*  This tutorial assumes that you know what xref:concepts/the_scene_graph.adoc[the Scene Graph] is.
 *  For a visual introduction, check out xref:concepts/scenegraph_for_dummies.adoc[Scene Graph for Dummies].
 
 When creating a 3D game

+ 1 - 1
docs/modules/tutorials/pages/beginner/hello_simpleapplication.adoc

@@ -163,7 +163,7 @@ a|I create the Box at the origin = at `Vector3f.ZERO`.
 
 |===
 
-If you are unfamiliar with the vocabulary, read more about xref:ROOT:jme3/the_scene_graph.adoc[the Scene Graph] here.
+If you are unfamiliar with the vocabulary, read more about xref:concepts/the_scene_graph.adoc[the Scene Graph] here.
 
 
 === Initialize the Scene

+ 1 - 1
docs/modules/tutorials/pages/concepts/faq.adoc

@@ -117,7 +117,7 @@ rootNode.detachChild(spatial); // remove from scene
 
 *Learn more:*
 
-* xref:ROOT:jme3/the_scene_graph.adoc[The Scene Graph]
+* xref:concepts/the_scene_graph.adoc[The Scene Graph]
 * xref:beginner/hello_node.adoc[Hello Node]
 * xref:beginner/hello_asset.adoc[Hello Asset]
 * xref:ROOT:jme3/advanced/spatial.adoc[Spatial]