|Re: [eigen] geometry module...|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] geometry module...
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 19 Mar 2010 16:01: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=f2qDF+jmXwUN3MyeGL2NjZ2uu6jUir7feC81JLopXDk=; b=XEk2FlGaZ4iYj1UgU0bSHpPZUd2GaXHtUh7wWFN0Eaf66Xl+zbP7JvYGhciEWfIwjQ NmKb+bGY58b+6p8OxAvzDscJEB2C3uAqzRX/ZvfnJQbAhqP4gIz46fQcJFRTNWOrMOul hCJzNzPboYKgrdNkwaGYSMlijBwEFOseYOiWA=
- 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=ltsL27AG8mVCANH3lNWo+2lOrGv+7jpiIMajWo2fx68eMyvYIyei64V4zcm3e0DVxU eLQnldv1XpSTq7YYvcR/XI4hsoVhRZJ2XUeqbv3GroUF0sYmpuJPGO+ufkkum0Mp1LgI NT1CMGGb7i76HJ4AylzjsTcOZJ0/LnxmXvpjM=
By the way, I wonder a bit about the Translation class. Most of the
time, the user has a vector and wants to apply the translation by that
vector, without any overhead.
Our Translation class doesn't allow that. It stores its own vector...
How to solve that? Perhaps this is the "usual Eigen way" to solve this
kind of problem:
- introduce TranslationWrapper class that is like Translation except
it wraps an existing expression
- introduce MatrixBase::asTranslation() returning a
TranslationWrapper, so one could do: some_vector.asTranslation()
- introduce TranslationBase factoring most of the code between
Translation and TranslationWrapper
Then this has the added benefit that it allows to very easily bring
expression templated to Translation: just let operator+ return a
We already discussed such plans for Quaternions. It's the same here.
The nice thing is: afaics, it doesn't break any API so there's no
emergency. But it would be very welcome... (unless someone
By the way there's a similar problem in other classes of the Geometry
module. If I have an existing 4x4 matrix and want to "view" it as a
Transform3d, currently Eigen doesn't allow me to do that, right?
That's pretty bad! I may be missing something. Anyway, in that case,
the same approach would work there too...
2010/3/19 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> My point is that we must preserve associativity (up to machine precision ;) )
> (Scaling * Translation) * Vector == Scaling * (Translation * Vector)
> We would lose that if we let Scaling * Translation return the
> translation by the scaled vector.
> 2010/3/19 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
>> On Fri, Mar 19, 2010 at 7:44 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>>>> - make UniformScale * Translation return a Translation
>>> I don't understand that. UniformScale * Translation should return the
>>> composite transformation, that consists in first translating and then
>>> scaling. This is not a translation!
>> Well, maybe the bigger problem is that we do not yet have expressions
>> in the transformation chain. A translation is not even a
>> transformation but it behaves as such since
>> Vector = Translation * Vector
>> is a valid operation - i.e. translations behaves like a transformation
>> matrices. And given
>> Vector = Scaling * Translation * Vector
>> which can be written as
>> Vector = (Scaling * Translation) * Vector = OtherTranslation * Vector
>> I considered returning a translation - in particular since
>> Translation * Vector
>> is way more efficient than
>> ProjectiveTransformation * Vector.
>> Maybe now I managed to maximize confusion but I agree that such a
>> trivial fix is not really a fix and thus I will leave it alone for the
>> - Hauke