Re: [eigen] Eigen appears to rock. |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Eigen appears to rock.*From*: jacob@xxxxxxxxxxxxxxx*Date*: Thu, 21 Aug 2008 16:37:30 +0200

One remark by the way:

T.affine() is the 3x3 affine part of the above 4x4 matrix (it represents the rotation + scale + shear)

Quoting Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:

Anyway, this let me though Transform could be slightly improved by adding the following explicit shortcuts: Vector3 transformPoint(Vector3) const; Vector3 transformVector(Vector3) const; Vector3 transformDifferentialVector(Vector3) const; Matrix3 normalMatrix() const; I'm not sure about transformDifferentialVector because it is very slow if you transform more than a single vector. normalMatrix() would returns the transformation matrix you have to use to transform your normals.

transformPoint is just operator* right? so let's keep just operator*.

Cheers, Benoit

cheers, gael. On Thu, Aug 21, 2008 at 6:22 AM, Thomas Vaughan <tevaughan@xxxxxxxxx> wrote:On Wed, Aug 20, 2008 at 9:31 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:Thanks for the kind words!You're welcome!For example, Transform3f is actually a 4x4 matrix and can represent any affine transformation on 3-space. You can multiply a Transform3f with a Vector3f.Hmm. This seems a bit unfortunate. In my naive imagination, although each of a Vector and a Point should have three components internally, ideally: - Applying a Transform to a Vector should give only a rotation, whereas applying the same Transform to a Point should give both a rotation and a translation, - The binary subtraction operator between two Points should return the displacement Vector from one point to the other. - The binary addition operator between a Point and a Vector should return the Point at the head of the Vector when its tail rests at the Point operand. - Most ordinary matrix stuff should work for a Vector, but only a few things, like those above, and individual coordinate access, should work for a Point. I've noticed that some nasty bugs can happen in application code because there is no proper distinction enforced between a Point and a Vector. For example, I've made the mistake of accidentally transforming point coordinates as though they were vector components. If a quantity were declared as a Point, then it would be nice by C++ typing to have the compiler warn the programmer that he is trying to treat something as though it were a Vector when it is really a Point. Alternatively it would be nice for the compiler just to do the appropriate thing automatically in the case of a coordinate transformation. Maybe, in the multiplication against the Transform, this would be as simple as - converting a Vector to a four-dimensional column whose w-component is zero but - converting a Point to a four-dimensional column whose w-component is one. I notice that operator* for Transform takes either an N-dimensional vector or an (N+1)-dimensional homogeneous vector. Does "homogeneous vector" imply unit value in the (N+1)-component? What (N+1)-component is supplied for the N-dimensional vector in this case? -- Thomas E. Vaughan There are only two kinds of people; those who accept dogma and know it, and those who accept dogma and don't know it. - G.K. Chesterton

---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.

**Follow-Ups**:**Re: [eigen] Eigen appears to rock.***From:*Thomas Vaughan

**References**:**[eigen] Eigen appears to rock.***From:*Thomas Vaughan

**Re: [eigen] Eigen appears to rock.***From:*Benoît Jacob

**Re: [eigen] Eigen appears to rock.***From:*Thomas Vaughan

**Re: [eigen] Eigen appears to rock.***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] MSVC build errors** - Next by Date:
**Re: [eigen] Eigen appears to rock.** - Previous by thread:
**Re: [eigen] Eigen appears to rock.** - Next by thread:
**Re: [eigen] Eigen appears to rock.**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |