From 8e8019d2898fbb0bdd4af53bc0a4852e37653385 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 27 Aug 2008 00:46:24 +0000 Subject: improvements in geometry tutorial --- doc/QuickStartGuide.dox | 65 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) (limited to 'doc/QuickStartGuide.dox') diff --git a/doc/QuickStartGuide.dox b/doc/QuickStartGuide.dox index 004156873..a4f2db946 100644 --- a/doc/QuickStartGuide.dox +++ b/doc/QuickStartGuide.dox @@ -522,7 +522,7 @@ To transform more than a single vector the prefered representations are rotation 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 +\subsection TutorialGeoCommonRotationAPI Common API across 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. @@ -559,19 +559,76 @@ In Eigen we have chosen to not distinghish between points and vectors such that 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. - + +t.fromPositionOrientationScale( + pos,any_3D_rotation,Vector3f(sx,sy,sz)); \endcode +glLoadMatrixf(t.data());\endcode + + + + + + + +
Creation\code +
\b 3D \b 2D
Creation \n rot2D can also be an angle in radian\code Transform3f t; -t.setFrom \endcode
\code +Transform2f t; +t.fromPositionOrientationScale( + pos,any_2D_rotation,Vector2f(sx,sy)); \endcode
Apply the transformation to a \b point \code Vector3f p1, p2; +p2 = t * p1;\endcode\code +Vector2f p1, p2; p2 = t * p1;\endcode
Apply the transformation to a \b vector \code Vector3f v1, v2; +v2 = t.linear() * v1;\endcode\code +Vector2f v1, v2; v2 = t.linear() * v1;\endcode
Concatenate two transformations\code +t3 = t1 * t2;\endcode\code t3 = t1 * t2;\endcode
OpenGL compatibility\code -glLoadMatrixf(t.data());\endcode
\code +Transform3f aux(Transform3f::Identity); +aux.linear().corner<2,2>(TopLeft) = t.linear(); +aux.translation().start<2>() = t.translation(); +glLoadMatrixf(aux.data());\endcode
\b Component \b accessors
translation part\code +t.translation() = vec3; +vec3 = t.translation(); +\endcode\code +t.translation() = vec2; +vec2 = t.translation(); +\endcode
linear part\code +t.linear() = mat3x3; +mat3x3 = t.linear(); +\endcode\code +t.linear() = mat2x2; +mat2x2 = t.linear(); +\endcode
\b Editing \b shortcuts
Applies a translation\code +t.translate(Vector3f(tx, ty, tz)); +t.pretranslate(Vector3f(tx, ty, tz)); +\endcode\code +t.translate(Vector2f(tx, ty)); +t.pretranslate(Vector2f(tx, ty)); +\endcode
Applies a rotation \n rot2D can also be an angle in radian\code +t.rotate(rot3D); +t.prerotate(rot3D); +\endcode\code +t.rotate(rot2D); +t.prerotate(rot2D); +\endcode
Applies a scaling\code +t.scale(Vector3f(sx, sy, sz)); +t.scale(Vector3f::Constant(s)); +t.prescale(Vector3f(sx, sy, sz)); +\endcode\code +t.scale(Vector2f(tx, ty)); +t.scale(Vector2f::Constant(s)); +t.prescale(Vector2f(tx, ty)); +\endcode
Applies a shear transformation \n(2D only)\code +t.shear(sx,sy); +t.preshear(sx,sy); +\endcode
-- cgit v1.2.3