Sfoglia il codice sorgente

Update hello_node.adoc

Fixed list continuation problem in "Understanding the code".
Fixed broken Quaternions link in table Rotation Turns Spatial.
mitm001 9 anni fa
parent
commit
7c1d76c13b
1 ha cambiato i file con 13 aggiunte e 6 eliminazioni
  1. 13 6
      src/docs/asciidoc/jme3/beginner/hello_node.adoc

+ 13 - 6
src/docs/asciidoc/jme3/beginner/hello_node.adoc

@@ -149,7 +149,8 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 **  Position the box at (1,-1,1) using the setLocalTranslation() method.
 **  Position the box at (1,-1,1) using the setLocalTranslation() method.
 **  Wrap the Box shape into a Geometry.
 **  Wrap the Box shape into a Geometry.
 **  Create a blue material. 
 **  Create a blue material. 
-**  Apply the blue material to the Box Geometry. 
+**  Apply the blue material to the Box Geometry.
++
 [source,java]
 [source,java]
 ----
 ----
 
 
@@ -163,11 +164,13 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 
 
 
 
 .  You create a second box Geometry.
 .  You create a second box Geometry.
++
 **  Create a second Box shape with the same size.
 **  Create a second Box shape with the same size.
 **  Position the second box at (1,3,1). This is straight above the first box, with a gap of 2 world units inbetween.
 **  Position the second box at (1,3,1). This is straight above the first box, with a gap of 2 world units inbetween.
 **  Wrap the Box shape into a Geometry.
 **  Wrap the Box shape into a Geometry.
 **  Create a red material. 
 **  Create a red material. 
 **  Apply the red material to the Box Geometry. 
 **  Apply the red material to the Box Geometry. 
++
 [source,java]
 [source,java]
 ----
 ----
 
 
@@ -182,37 +185,41 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 
 
 
 
 .  You create a pivot Node. 
 .  You create a pivot Node. 
++
 **  Name the Node “pivot.
 **  Name the Node “pivot.
 **  By default the Node is positioned at (0,0,0). 
 **  By default the Node is positioned at (0,0,0). 
 **  Attach the Node to the rootNode.
 **  Attach the Node to the rootNode.
 **  The Node has no visible appearance in the scene. 
 **  The Node has no visible appearance in the scene. 
++
 [source,java]
 [source,java]
 ----
 ----
 
 
     Node pivot = new Node("pivot");
     Node pivot = new Node("pivot");
     rootNode.attachChild(pivot);
     rootNode.attachChild(pivot);
 ----
 ----
-
++
 If you run the application with only the code up to here, the scene appears empty. This is because a Node is invisible, and you have not yet attached any visible Geometries to the rootNode. 
 If you run the application with only the code up to here, the scene appears empty. This is because a Node is invisible, and you have not yet attached any visible Geometries to the rootNode. 
 
 
 
 
 .  Attach the two boxes to the pivot node. 
 .  Attach the two boxes to the pivot node. 
++
 [source,java]
 [source,java]
 ----
 ----
 
 
         pivot.attachChild(blue);
         pivot.attachChild(blue);
         pivot.attachChild(red);
         pivot.attachChild(red);
 ----
 ----
-
++
 If you run the app with only the code up to here, you see two cubes: A red cube straight above a blue cube.
 If you run the app with only the code up to here, you see two cubes: A red cube straight above a blue cube.
 
 
 .  Rotate the pivot node.
 .  Rotate the pivot node.
++
 [source,java]
 [source,java]
 ----
 ----
         pivot.rotate( 0.4f , 0.4f , 0.0f );
         pivot.rotate( 0.4f , 0.4f , 0.0f );
 ----
 ----
-
- If you run the app now, you see two boxes on top of each other – both tilted at the same angle.
++
+If you run the app now, you see two boxes on top of each other – both tilted at the same angle.
 
 
 
 
 
 
@@ -357,7 +364,7 @@ To roll an object 180° around the z axis:
 thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );
 thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );
 ----
 ----
 
 
- Tip: If your game idea calls for a serious amount of rotations, it is worth looking into <<jme3/quaternion#,quaternion>>s, a data structure that can combine and store rotations efficiently. 
+Tip: If your game idea calls for a serious amount of rotations, it is worth looking into <<jme3/quaternion#,quaternions>>, a data structure that can combine and store rotations efficiently. 
 
 
 [source,java]
 [source,java]
 ----
 ----