Re: [eigen] Re: Rigid transformations in eigen: use of dual quaternions

[ Thread Index | Date Index | More Archives ]

careful, your patch affects test/CMakeLists.txt in unwanted ways !

that aside: for now, we only dealt with unit quaternions. These are
the quaternions that correspond to 3D rotations.

That's the main reason why we didn't implement q1+q2 and q*scalar.

Now your patch does work, but it's not always efficient, because the
operators return by value and so when you do s1*q1+s2*q2 you traverse
the arrays 3 times instead of once. Again this doesn't matter with
floats and SSE, but it does with double and/or without SSE.

Making this efficient would require again doing expression templates.
If we wanted to take that route, I guess we could as well make
Quaternion inherit MatrixBase instead of reimplementing everything. Or
even Matrix. I don't remember the chain of thinking that led to the
current design, it's Gael who took care of that. It has the advantage
of being simple and covering _unit_ quaternions appropriately.

But are you sure that what you're trying to do with s1*q1+s2*q2 isn't
just the same as slerp() ? because it looks seriously reminiscent of


2009/9/12 Rohit Garg <rpg.314@xxxxxxxxx>:
> Any particular reason why eigen does not support expressions like
> s1*q1+s2*q2 where s1 and s2 are scalrs and q1 and q2 are quaternions?
> Here is a tiny patch for quaternion.h to add them,
> I would have committed it to my branch and pointed you to it, but I am
> having trouble with hg behind proxy once more. So please commit this
> (I mean to eigen mainline  unstable branch!).
> On Sat, Sep 12, 2009 at 6:17 PM, Rohit Garg <rpg.314@xxxxxxxxx> wrote:
>> Hi,
>> a) What is the internal representation of affine transformations
>> (excluding scaling) in eigen?
>> b) I am right now rolling my own dual quaternion class, but if eigen
>> provides dual quaternions (say as RigidTransform class, to exclude
>> scaling) then it would be very useful indeed.
>> c) Dual quaternions have many advantages, in that they allow artifact
>> free skining, rigid transform interpolation, are resistant to
>> numerical defects (just like quaternions). Was their use considered
>> and discarded?
>> d) The recently introduced EIGEN_TRANSFORM_PLUGIN, what does it do?
>> e) Interpolation is the key thing here. We need it and we are having
>> to do it ourselves. But we'd like to have the code rolled into eigen,
>> so that it plays nice with the rest of the geometry api and allows
>> convenient extraction of matrices (to upload as uniforms to shaders).
>> --
>> Rohit Garg
>> Senior Undergraduate
>> Department of Physics
>> Indian Institute of Technology
>> Bombay
> --
> Rohit Garg
> Senior Undergraduate
> Department of Physics
> Indian Institute of Technology
> Bombay

Mail converted by MHonArc 2.6.19+