Преглед изворни кода

Update rotate.adoc

Fixed improperly added new line breaks.
Fixed note and important Admonitions.
mitm001 пре 9 година
родитељ
комит
411c49488d
1 измењених фајлова са 15 додато и 15 уклоњено
  1. 15 15
      src/docs/asciidoc/jme3/rotate.adoc

+ 15 - 15
src/docs/asciidoc/jme3/rotate.adoc

@@ -7,15 +7,16 @@
 ifdef::env-github,env-browser[:outfilesuffix: .adoc]
 ifdef::env-github,env-browser[:outfilesuffix: .adoc]
 
 
 
 
-_Bad news: 3D rotation is done using matrix calculus. +Good news: If you do not understand calculus, there are two simple rules how you get it right._
+_Bad news: 3D rotation is done using matrix calculus. +
+Good news: If you do not understand calculus, there are two simple rules how you get it right._
 
 
-+
 
 
 *3D rotation* is a crazy mathematical operation where you need to multiply all vertices in your object by four floating point numbers; the multiplication is referred to as concatenation, the array of four numbers {x,y,z,w} is referred to as quaternion. Don't worry, the 3D engine does the tough work for you. All you need to know is:
 *3D rotation* is a crazy mathematical operation where you need to multiply all vertices in your object by four floating point numbers; the multiplication is referred to as concatenation, the array of four numbers {x,y,z,w} is referred to as quaternion. Don't worry, the 3D engine does the tough work for you. All you need to know is:
 
 
 *The Quaternion* is an object capable of deep-freezing and storing a rotation that you can apply to a 3D object.
 *The Quaternion* is an object capable of deep-freezing and storing a rotation that you can apply to a 3D object.
 
 
 
 
+
 == Using Quaternions for Rotation
 == Using Quaternions for Rotation
 
 
 To store a rotation in a Quaternion, you must specify two things: The angle and the axis of the rotation.
 To store a rotation in a Quaternion, you must specify two things: The angle and the axis of the rotation.
@@ -23,8 +24,6 @@ To store a rotation in a Quaternion, you must specify two things: The angle and
 *  The rotation angle is defined as a multiple of the number PI.
 *  The rotation angle is defined as a multiple of the number PI.
 *  The rotation axis is defined by a vector: Think of them in terms of “pitch, “yaw, and “roll.
 *  The rotation axis is defined by a vector: Think of them in terms of “pitch, “yaw, and “roll.
 
 
-+
-
 Example:
 Example:
 
 
 [source,java]
 [source,java]
@@ -40,7 +39,6 @@ thingamajig.setLocalRotation( roll180 );
 
 
 So how to choose the right numbers for the Quaternion parameters? I'll give you my cheat-sheet:
 So how to choose the right numbers for the Quaternion parameters? I'll give you my cheat-sheet:
 
 
-+
 [cols="3", options="header"]
 [cols="3", options="header"]
 |===
 |===
 
 
@@ -62,10 +60,11 @@ a| A plane rolls or banks. Cocking your head.
 
 
 |===
 |===
 
 
-+
-Note: These are the three most common examples – technically you can rotate around any axis expressed by a vector.
+[NOTE]
+====
+These are the three most common examples – technically you can rotate around any axis expressed by a vector.
+====
 
 
-+
 [cols="3", options="header"]
 [cols="3", options="header"]
 |===
 |===
 
 
@@ -99,10 +98,11 @@ a| any angle `g`
 
 
 |===
 |===
 
 
-+
-*Important:* You must specify angles in link:http://en.wikipedia.org/wiki/Radian[Radian]s (multiples or fractions of PI). If you use degrees, you will just get useless results.
+[IMPORTANT]
+====
+You must specify angles in link:http://en.wikipedia.org/wiki/Radian[Radian]s (multiples or fractions of PI). If you use degrees, you will just get useless results.
+====
 
 
-+
 How to use these tables to speficy a certain rotation:
 How to use these tables to speficy a certain rotation:
 
 
 .  Pick the appropriate vector from the axis table.
 .  Pick the appropriate vector from the axis table.
@@ -115,6 +115,7 @@ Quaternion objects can be used as often as you want, so give them meaningfull na
 link:http://moddb.wikia.com/wiki/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation[More about Quaternions]…
 link:http://moddb.wikia.com/wiki/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation[More about Quaternions]…
 
 
 
 
+
 == Code Sample
 == Code Sample
 
 
 [source,java]
 [source,java]
@@ -147,11 +148,11 @@ You can specify two rotations, and then have jme calculate (interpolate) the ste
 
 
 == "Adding" Rotations
 == "Adding" Rotations
 
 
-You can concatenate (add) rotations: This means you turn the object first around one axis, then around the other, in one step.
-
+You can concatenate (add) rotations: This means you turn the object first around one axis, then around the other, in one step. +
 `Quaternion myRotation =  pitch90.mult(roll45); /* pitch and roll */`
 `Quaternion myRotation =  pitch90.mult(roll45); /* pitch and roll */`
 
 
 
 
+
 == Troubleshooting Rotations
 == Troubleshooting Rotations
 
 
 Does the object end up in an unexpected location, or at an unexpected angle? If you are getting weird results, check the following:
 Does the object end up in an unexpected location, or at an unexpected angle? If you are getting weird results, check the following:
@@ -161,13 +162,12 @@ Does the object end up in an unexpected location, or at an unexpected angle? If
 .  Did you enter the angle in degrees (0 - 360°) or radians (0 - 2*PI)? A 3D engine expects radians, so make sure to convert your values! Formula: `g° = FastMath.PI * g / 180`
 .  Did you enter the angle in degrees (0 - 360°) or radians (0 - 2*PI)? A 3D engine expects radians, so make sure to convert your values! Formula: `g° = FastMath.PI * g / 180`
 
 
 
 
+
 == Tip: Transformation Matrix
 == Tip: Transformation Matrix
 
 
 This here is just about rotation, but there are three types of 3-D transformation: <<jme3/rotate#,rotate>>, <<jme3/scale#,scale>>, and <<jme3/translate#,translate>>.
 This here is just about rotation, but there are three types of 3-D transformation: <<jme3/rotate#,rotate>>, <<jme3/scale#,scale>>, and <<jme3/translate#,translate>>.
 
 
 You can do all transformations in individual steps (and then update the objects geometry and bounds), or you can combine them and transform the object in one step. If you have a lot of repetitive movement going on in your game it's worth learning more about Transformation Matrices for optimization. JME can also help you interpolate the steps between two fixed transformations.
 You can do all transformations in individual steps (and then update the objects geometry and bounds), or you can combine them and transform the object in one step. If you have a lot of repetitive movement going on in your game it's worth learning more about Transformation Matrices for optimization. JME can also help you interpolate the steps between two fixed transformations.
 
 
-+
-
 *  com.jme3.math.Transform, interpolateTransforms() – interpolate a step between two transformations
 *  com.jme3.math.Transform, interpolateTransforms() – interpolate a step between two transformations
 **  link:http://javadoc.jmonkeyengine.org/com/jme3/math/Transform.html[com.jme.math.Transform]
 **  link:http://javadoc.jmonkeyengine.org/com/jme3/math/Transform.html[com.jme.math.Transform]