|Re: [eigen] Re: Rigid transformations in eigen: use of dual quaternions|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Re: Rigid transformations in eigen: use of dual quaternions
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Sat, 12 Sep 2009 10:29:24 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=WZxWLxvEvZOKJqpcthQd764+4rof2k1gh9HRLlnZHXE=; b=JKSHFEEhpgPf69nd2S3egUfR59FxbuMSbKYL7Ywcm67r5grpzK+qbPcTX8lB6DT6aa 4P9hdj9PwQnzkMyGWITYhuSZTS47hiwURI5NvRISyBjqTCLzKXjdbHOugTUm8C2PSscf a5iN1Awv1+Rqanv3rKeC5MVg1N1gTn3m2dnA4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=G40I3vqB/iw57Ew1nlmPUMIv1asyFSapA8mCikmSHzPAcVM3PFWhuoOqFnxjHogsSu cxKL45Jxxi1XOl8OkYieEEqdFI35wKVWZ5w0rAmJm0RtCG24pvng7YuIdARKwLUOVZWk Wkb/rvcXiCDtkCnKXMN4vjQ6cycQIW+I9RLpc=
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:
>> 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
> Rohit Garg
> Senior Undergraduate
> Department of Physics
> Indian Institute of Technology