Re: [eigen] Eigen appears to rock.

[ Thread Index | Date Index | More Archives ]

On Wed, Aug 20, 2008 at 9:31 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx>
> 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,

 - 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

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

Mail converted by MHonArc 2.6.19+