|Re: [eigen] Rigid Transformations in eigen: discussion thread|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Rigid Transformations in eigen: discussion thread
- From: Rohit Garg <rpg.314@xxxxxxxxx>
- Date: Wed, 16 Sep 2009 16:06:18 +0530
- 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; bh=KRxSwj1a++0Q7LvbK5qmGdIxAgS/B1vz2LD1l+DTGIQ=; b=ZLwY49G6ragf2T9Kmb0iw+GoXLw6XqmSmLMGFdGgeHvf1lHSVvFRtRN6P90eDiKJH/ Z3nuKLC1A5U7glccwtGjd3+efyHoGvMUFENVEtGOsw+ZN9HdvD+TnUFcJFFlvndhKctn wvmov/zpS55KloLaiMP5/z2rBQUMQ5vZ0VeY4=
- 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; b=N3MpBqMzlnWYcxCeUBGUaX/M1GEZ8cR+Fg5U5++bNRUF4o2Zhx9/R9c1GGOShLSK37 BSOjUUEzy1EUnAHgDW4mkpprgfotFTR1lgIVSgbjE5C12Vykzg6T4OfTC//N+FCtY2z5 Z96FpNs6OH6sTUKsjl99HenI0EacNUvLu9ZSk=
>> a) This heavily depends on fast quaternion multiplication, I think it
>> will likely come out somewhat behind in benches.
> OK, so it would definitely be nice to know how much behind. I haven't peeked
> into the internals of the Quaternion class, but would this difference be due
> to the current implementation, or rather inherent to the involved operations
> and their efficient vectorization?
Quaternion multiplication is vectorized, and is ~2x faster than it's
scalar equivalent. I dont know how to speed it up, apart from
scheduling instructions by hand. Suggestions most welcome. Multiplying
dual quaternions takes 3 quaternion multiplications and one addition.
Off the top of my head, Matrix4f multiplication takes 28 SSE
instructions at the minimum. A quaternion multiplication takes 7 and
addition just one. So theoretically, it may be faster, but modern
Intel CPU's can dual issue a mul and an add per clock, so by careful
ordering, it may be possible to do the matrix multiplication in lesser
(~half) cycles. The only real way to know for sure is to bench it. And
I dont have time for it now, but I'd be interested in the benchmarks.
>> b) How does eigen do say, 4D rotations? I thought it did only 2D and
>> 3D rotations.
> In the Transform class, a higher-dimensional rotation would be the linear
> part set to a square nD orthonormal matrix
But you will have to manage the orthonormal matrix yourselves right? I
mean is there an angle axis or its equivalent for 4D? Any support for
composing 4d rotations in eigen?
>> I don't know if rigid transformations make sense for 2D.
> They do :) , rigid transformations make sense in nD
> Sure. The main point is that a specialization for rigid transformations
> could be very useful. The Transform class already takes isometries into
> account up to a certain extent (as a hint when computing the inverse), but
> it would be nice to have a way of creating isometries, and guaranteeing that
> they stay that way. With the current Transform class, you could for example
> compose multiple isometries and because of roundoff errors end up with
> something that is not an isometry, and restoring orthonormality of the
> linear part is not trivial. For 3D isometries, renormalizing a quaternion is
> all you need (or similar for dual quaternions). This is why your
> contribution seems worth exploring :).
The thing is a Transform object could also contain a scaling/shearing
transformation, which is unacceptable for a rigid transformation. The
transform class is suitable for opengl transform matrices, but not for
The biggest advantage, the raison d'etre of this class, is
interpolation of rigid transformations, essential in animations.
Department of Physics
Indian Institute of Technology