Re: [eigen] get scaling out of transform? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] get scaling out of transform?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 22 Jan 2009 20:45:12 +0100
- 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=bn/aI/PCYmCYkmGirDj0DdiZWfdoL0sgeNQG/A+lvSU=; b=ZaO4g4ra9vQJxl5/ugufLeAi82S0SPaPGO2cZ81AdiconK+NACqfA5V8HnTP5vrmqL I6yOt+VmCJ2ic4TbzQc4yCFmUHWqZHOZl1RTVEvPvynmHcRTYgPomN/XFT24UyTeuxiw B9UCeBFRrq21sBo7U+VMkmzh67AIqSu9L5+Ag=
- 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=KWOiqiwNM+5yUoCbQOsxzPM+U1Mb61r/gvRvG2oSBBPRNLc5bs2gEPzJ8+PPXn5vaK EhRs0pdJ5707G2TVlRHU6oJnX786QvwwhzmGHGOARvzEyvMY1kqV1/Vet6X2Vkz/qCj3 Gq6++FqrdOdq/EV9ER2L/acPYn4thShvXs7lA=
OH ok I see the problem: you tried passing a Scaling* but the function
actually expects a Matrix.
I'll clarify this. Maybe by letting the function take a MatrixBase* or
even a Matrix*
I understand that the terminology "ScalingType" was confusing then.
There's a good reason why it can't take a Scaling*. A Scaling is just
an abstract scaling, eg. in 3D it is just 3 numbers. It remembers only
the scaling _amplitude_ but not the scaling _orientation_.
The function computes the whole scaling matrix.
If you are interested only in the scaling amplitudes as positive
numbers (so not taking into account any reflection that would change
signs) then what you're after is just the singular values of your
matrix:
Transform3d t;
Vector3d scalingAmplitudes = t.linear().svd().singularValues();
Cheers,
Benoit
2009/1/22 Ben Axelrod <baxelrod@xxxxxxxxxxxx>:
> Thank you for your help Benoit,
>
> I checked out the latest source and tried to use the new function. But I got this compilation error:
>
> Compiling ./src/IEntityPlugin.cpp
>
> /External/Eigen/2.1/include/Eigen/src/SVD/SVD.h: In member function 'void Eigen::SVD<MatrixType>::computeScalingRotation(ScalingType*, RotationType*) const [with ScalingType = HSimScaling3x3, RotationType = HSimRotation3x3, MatrixType = Eigen::Matrix<double, 3, 3, 2, 3, 3>]':
>
> /External/Eigen/2.1/include/Eigen/src/Geometry/Transform.h:651: instantiated from 'void Eigen::Transform<Scalar, Dim>::computeScalingRotation(ScalingMatrixType*, RotationMatrixType*) const [with ScalingMatrixType = HSimScaling3x3, RotationMatrixType = HSimRotation3x3, _Scalar = double, int _Dim = 3]'
> IEntityPlugin.cpp:361: instantiated from here
>
> /External/Eigen/2.1/include/Eigen/src/SVD/SVD.h:625: error: 'class Eigen::Scaling<double, 3>' has no member named 'lazyAssign'
>
> It seems Scaling is missing 'lazyAssign'. Or am I missing something?
> Thanks,
> -Ben
>
>
>
> -----Original Message-----
> From: Listengine [mailto:listengine@xxxxxxxxxxxxxxxxx] On Behalf Of Benoit Jacob
> Sent: Thursday, January 22, 2009 11:46 AM
> To: eigen@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [eigen] get scaling out of transform?
>
>> ---OR---
>>
>> t.computeRotationScaling(&scaling, &rotation);
>
> OOPS. I meant this:
>
> t.computeScalingRotation(&scaling, &rotation);
>
> Cheers,
> Benoit
>
>
>
>
>