RE: [eigen] get scaling out of transform? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Thanks for the info. I can just use a regular matrix instead. And I should, because I do need the scaling orientation. I guess I assumed the Scaling type did have a full matrix behind the scenes...
-Ben
-----Original Message-----
From: Listengine [mailto:listengine@xxxxxxxxxxxxxxxxx] On Behalf Of Benoit Jacob
Sent: Thursday, January 22, 2009 2:45 PM
To: eigen@xxxxxxxxxxxxxxxxxxx
Subject: Re: [eigen] get scaling out of transform?
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
>
>
>
>
>