From 63d3ef8204d5687ce6ec3559d1c5451a425d21a2 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 26 Aug 2008 23:07:33 +0000 Subject: * remove debug code commited by mistake in Assign * keep going on the doc: added a short geometry tutorial --- doc/QuickStartGuide.dox | 79 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 3 deletions(-) (limited to 'doc/QuickStartGuide.dox') diff --git a/doc/QuickStartGuide.dox b/doc/QuickStartGuide.dox index 50abf8b4d..004156873 100644 --- a/doc/QuickStartGuide.dox +++ b/doc/QuickStartGuide.dox @@ -492,17 +492,88 @@ forces immediate evaluation of the transpose | \ref TutorialAdvancedLinearAlgebra "Advanced linear algebra" +In this tutorial chapter we will shortly introduce the many possibilities offered by the \ref GeometryModule "geometry module", +namely 2D and 3D rotations and affine transformations. + \b Table \b of \b contents - \ref TutorialGeoRotations - \ref TutorialGeoTransformation top\section TutorialGeoRotations 2D and 3D Rotations -todo +\subsection TutorialGeoRotationTypes Rotation types -top\section TutorialGeoTransformation 2D and 3D Transformations -todo + + + + + + + +
Rotation typeTypical initialization codeRecommended usage
2D rotation from an angle\code +Rotation2D rot2(angle_in_radian);\endcode
2D rotation matrix\code +Matrix2f rotmat2 = Rotation2Df(angle_in_radian);\endcode
3D rotation as an angle + axis\code +AngleAxis aa(angle_in_radian, Vector3f(ax,ay,az));\endcode
3D rotation as a quaternion\code +Quaternion q = AngleAxis(angle_in_radian, axis);\endcode
3D rotation matrix\code +Matrix3f rotmat3 = AngleAxis(angle_in_radian, axis);\endcode
+ +To transform more than a single vector the prefered representations are rotation matrices, +for other usage Rotation2D and Quaternion are the representations of choice as they are +more compact, fast and stable. AngleAxis are only useful to create other rotation objects. + +\subsection TutorialGeoCommonRotationAPI Common API of rotation types + +To some extent, Eigen's \ref Geometry_Module "geometry module" allows you to write +generic algorithms working on both 2D and 3D rotations of any of the five above types. +The following operation are supported: + + + + + + +
Convertion from and to any types (of same space dimension)\code +RotType2 a = RotType1();\endcode
Concatenation of two rotations\code +rot3 = rot1 * rot2;\endcode
Apply the rotation to a vector\code +vec2 = rot1 * vec1;\endcode
Get the inverse rotation \n (not always the most effient choice)\code +rot2 = rot1.inverse();\endcode
Spherical interpolation \n (Rotation2D and Quaternion only)\code +rot3 = rot1.slerp(alpha,rot2);\endcode
+ +\subsection TutorialGeoEulerAngles Euler angles + + +
+Euler angles might be convenient to create rotation object. +Since there exist 24 differents convensions, they are one +the ahand pretty confusing to use. This example shows how +to create a rotation matrix according to the 2-1-2 convention.\code +Matrix3f m; +m = AngleAxisf(angle1, Vector3f::UnitZ()) + * AngleAxisf(angle2, Vector3f::UnitY()) + * AngleAxisf(angle3, Vector3f::UnitZ()); +\endcode
+ +top\section TutorialGeoTransformation Affine transformations +In Eigen we have chosen to not distinghish between points and vectors such that all points are +actually represented by displacement vector from the origine (pt \~ pt-0). With that in mind, +real points and vector distinguish when the rotation is applied. + + + + + + +
Creation\code +Transform3f t; +t.setFrom \endcode
Apply the transformation to a \b point \code +Vector3f p1, p2; +p2 = t * p1;\endcode
Apply the transformation to a \b vector \code +Vector3f v1, v2; +v2 = t.linear() * v1;\endcode
Concatenate two transformations\code +t3 = t1 * t2;\endcode
OpenGL compatibility\code +glLoadMatrixf(t.data());\endcode
+ */ @@ -519,6 +590,8 @@ todo | \b Advanced \b linear \b algebra + + \b Table \b of \b contents - \ref TutorialAdvLinearSolvers - \ref TutorialAdvLU -- cgit v1.2.3