[eigen] Re: Translation times Rotation

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Ok, it needs to be a little bit different:

  template<typename Derived>
  inline IsometryTransformType operator*(const
RotationBase<Derived,Dim>& r) const
  {
    IsometryTransformType res;
    res.matrix().setZero();
    res.linear() = r.toRotationMatrix().derived();
    res.translation() = m_coeffs;
    res.matrix().row(Dim).setZero();
    res(Dim,Dim) = Scalar(1);
    return res;
  }

Here, it's working...

- Hauke

On Mon, Jul 18, 2011 at 7:22 PM, Hauke Heibel
<hauke.heibel@xxxxxxxxxxxxxx> wrote:
> Hi guys,
>
> would anybody mind if I changed
>
>  template<typename Derived>
>  inline AffineTransformType operator*(const RotationBase<Derived,Dim>& r) const
>  { return *this * r.toRotationMatrix(); }
>
> in the Translation class to
>
>  template<typename Derived>
>  inline Transform<Scalar,Dim,Isometry> operator*(const
> RotationBase<Derived,Dim>& r) const
>  { return *this * r.toRotationMatrix(); }
>
> ??
>
> I have a function in which I want to create a random
> Transform<Scalar,Dim,Isometry> but returning a product of
>
> Translation<...> * Rotation2D
>
> does not work because of the issue above.
>
> Regards,
> Hauke
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/