diff options
Diffstat (limited to 'doc/C08_TutorialGeometry.dox')
-rw-r--r-- | doc/C08_TutorialGeometry.dox | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/doc/C08_TutorialGeometry.dox b/doc/C08_TutorialGeometry.dox index 9df19e793..b2890dbc6 100644 --- a/doc/C08_TutorialGeometry.dox +++ b/doc/C08_TutorialGeometry.dox @@ -38,18 +38,18 @@ But note that unfortunately, because of how C++ works, you can \b not do this: \section TutorialGeoElementaryTransformations Transformation types -<table class="tutorial_code"> -<tr><td>Transformation type</td><td>Typical initialization code</td></tr> +<table class="manual"> +<tr><th>Transformation type</th><th>Typical initialization code</th></tr> <tr><td> \ref Rotation2D "2D rotation" from an angle</td><td>\code Rotation2D<float> rot2(angle_in_radian);\endcode</td></tr> -<tr><td> +<tr class="alt"><td> 3D rotation as an \ref AngleAxis "angle + axis"</td><td>\code AngleAxis<float> aa(angle_in_radian, Vector3f(ax,ay,az));\endcode</td></tr> <tr><td> 3D rotation as a \ref Quaternion "quaternion"</td><td>\code Quaternion<float> q = AngleAxis<float>(angle_in_radian, axis);\endcode</td></tr> -<tr><td> +<tr class="alt"><td> N-D Scaling</td><td>\code Scaling<float,2>(sx, sy) Scaling<float,3>(sx, sy, sz) @@ -61,7 +61,7 @@ Translation<float,2>(tx, ty) Translation<float,3>(tx, ty, tz) Translation<float,N>(s) Translation<float,N>(vecN)\endcode</td></tr> -<tr><td> +<tr class="alt"><td> N-D \ref TutorialGeoTransform "Affine transformation"</td><td>\code Transform<float,N,Affine> t = concatenation_of_any_transformations; Transform<float,3,Affine> t = Translation3f(p) * AngleAxisf(a,axis) * Scaling3f(s);\endcode</td></tr> @@ -86,7 +86,7 @@ kind of transformations. Any of the above transformation types can be converted to any other types of the same nature, or to a more generic type. Here are some additional examples: -<table class="tutorial_code"> +<table class="manual"> <tr><td>\code Rotation2Df r = Matrix2f(..); // assumes a pure rotation matrix AngleAxisf aa = Quaternionf(..); @@ -103,15 +103,15 @@ Affine3f m = Translation3f(..); Affine3f m = Matrix3f(..); To some extent, Eigen's \ref Geometry_Module "geometry module" allows you to write generic algorithms working on any kind of transformation representations: -<table class="tutorial_code"> +<table class="manual"> <tr><td> Concatenation of two transformations</td><td>\code gen1 * gen2;\endcode</td></tr> -<tr><td>Apply the transformation to a vector</td><td>\code +<tr class="alt"><td>Apply the transformation to a vector</td><td>\code vec2 = gen1 * vec1;\endcode</td></tr> <tr><td>Get the inverse of the transformation</td><td>\code gen2 = gen1.inverse();\endcode</td></tr> -<tr><td>Spherical interpolation \n (Rotation2D and Quaternion only)</td><td>\code +<tr class="alt"><td>Spherical interpolation \n (Rotation2D and Quaternion only)</td><td>\code rot3 = rot1.slerp(alpha,rot2);\endcode</td></tr> </table> @@ -123,12 +123,12 @@ is a (Dim+1)^2 matrix. In Eigen we have chosen to not distinghish between points vectors such that all points are actually represented by displacement vectors from the origin ( \f$ \mathbf{p} \equiv \mathbf{p}-0 \f$ ). With that in mind, real points and vector distinguish when the transformation is applied. -<table class="tutorial_code"> +<table class="manual"> <tr><td> Apply the transformation to a \b point </td><td>\code VectorNf p1, p2; p2 = t * p1;\endcode</td></tr> -<tr><td> +<tr class="alt"><td> Apply the transformation to a \b vector </td><td>\code VectorNf vec1, vec2; vec2 = t.linear() * vec1;\endcode</td></tr> @@ -138,14 +138,14 @@ Apply a \em general transformation \n to a \b normal \b vector VectorNf n1, n2; MatrixNf normalMatrix = t.linear().inverse().transpose(); n2 = (normalMatrix * n1).normalized();\endcode</td></tr> -<tr><td> +<tr class="alt"><td> Apply a transformation with \em pure \em rotation \n to a \b normal \b vector (no scaling, no shear)</td><td>\code n2 = t.linear() * n1;\endcode</td></tr> <tr><td> OpenGL compatibility \b 3D </td><td>\code glLoadMatrixf(t.data());\endcode</td></tr> -<tr><td> +<tr class="alt"><td> OpenGL compatibility \b 2D </td><td>\code Affine3f aux(Affine3f::Identity); aux.linear().topLeftCorner<2,2>() = t.linear(); @@ -153,14 +153,14 @@ aux.translation().start<2>() = t.translation(); glLoadMatrixf(aux.data());\endcode</td></tr> </table> -\b Component \b accessors</td></tr> -<table class="tutorial_code"> +\b Component \b accessors +<table class="manual"> <tr><td> full read-write access to the internal matrix</td><td>\code t.matrix() = matN1xN1; // N1 means N+1 matN1xN1 = t.matrix(); \endcode</td></tr> -<tr><td> +<tr class="alt"><td> coefficient accessors</td><td>\code t(i,j) = scalar; <=> t.matrix()(i,j) = scalar; scalar = t(i,j); <=> scalar = t.matrix()(i,j); @@ -170,7 +170,7 @@ translation part</td><td>\code t.translation() = vecN; vecN = t.translation(); \endcode</td></tr> -<tr><td> +<tr class="alt"><td> linear part</td><td>\code t.linear() = matNxN; matNxN = t.linear(); @@ -185,8 +185,8 @@ matNxN = t.extractRotation(); \b Transformation \b creation \n While transformation objects can be created and updated concatenating elementary transformations, the Transform class also features a procedural API: -<table class="tutorial_code"> -<tr><td></td><td>\b procedurale \b API </td><td>\b equivalent \b natural \b API </td></tr> +<table class="manual"> +<tr><th></th><th>procedurale API</th><th>equivalent natural API </th></tr> <tr><td>Translation</td><td>\code t.translate(Vector_(tx,ty,..)); t.pretranslate(Vector_(tx,ty,..)); @@ -194,7 +194,7 @@ t.pretranslate(Vector_(tx,ty,..)); t *= Translation_(tx,ty,..); t = Translation_(tx,ty,..) * t; \endcode</td></tr> -<tr><td>\b Rotation \n <em class="note">In 2D and for the procedural API, any_rotation can also \n be an angle in radian</em></td><td>\code +<tr class="alt"><td>\b Rotation \n <em class="note">In 2D and for the procedural API, any_rotation can also \n be an angle in radian</em></td><td>\code t.rotate(any_rotation); t.prerotate(any_rotation); \endcode</td><td>\code @@ -212,14 +212,14 @@ t *= Scaling_(s); t = Scaling_(sx,sy,..) * t; t = Scaling_(s) * t; \endcode</td></tr> -<tr><td>Shear transformation \n ( \b 2D \b only ! )</td><td>\code +<tr class="alt"><td>Shear transformation \n ( \b 2D \b only ! )</td><td>\code t.shear(sx,sy); t.preshear(sx,sy); \endcode</td><td></td></tr> </table> Note that in both API, any many transformations can be concatenated in a single expression as shown in the two following equivalent examples: -<table class="tutorial_code"> +<table class="manual"> <tr><td>\code t.pretranslate(..).rotate(..).translate(..).scale(..); \endcode</td></tr> @@ -231,7 +231,7 @@ t = Translation_(..) * t * RotationType(..) * Translation_(..) * Scaling_(..); <a href="#" class="top">top</a>\section TutorialGeoEulerAngles Euler angles -<table class="tutorial_code"> +<table class="manual"> <tr><td style="max-width:30em;"> Euler angles might be convenient to create rotation objects. On the other hand, since there exist 24 differents convension,they are pretty confusing to use. This example shows how |