Discussion:
[mitk-users] Problems with orientation Quaternion of NavigationData
Albert Alises
2017-02-28 13:35:13 UTC
Permalink
Hello,

I am trying to set a CameraVisualiser to set up a camera that follows a
mesh around the space. To do so I need a navigation data that is used as
the input of the camera visualiser. The problem is that the mesh movement *does
not come from a tracking system*. However, I know the position of the mesh
at each frame and also its orientation (a vector defining the axis the mesh
is looking at), so at each frame It should be possible to define a new
navigationData.

When I try to set the navigation data, the position is correctly placed
using *SetPosition(mitk::Point3D) *but I am confused about the orientation,
as it is represented by a quaternion on the method of
*SetOrientation(mitk::Quaternion)*. How can I represent the orientation in
a quaternion given a direction vector or the axis the mesh is aligned
(let's say, (0.5,0.5,0))?

Thank you very much,
Albert.
Alfred Franz
2017-03-08 16:06:26 UTC
Permalink
Dear Albert,

the mitk::Quaternion is only a typedef of the vnl_quaternion class [1].
For the vnl_quaternion there is a constructor for 3D vectors (as well as
euler angles, etc.). You can use the vnl_quaternion constructor to get a
quaternion from your direction vector and use it as orientation for you
navigation data. Does this solve your problem?

Best regards,

Alfred Franz

[1]
https://public.kitware.com/vxl/doc/release/core/vnl/html/classvnl__quaternion.html
Post by Albert Alises
Hello,
I am trying to set a CameraVisualiser to set up a camera that follows
a mesh around the space. To do so I need a navigation data that is
used as the input of the camera visualiser. The problem is that the
mesh movement *does not come from a tracking system*. However, I know
the position of the mesh at each frame and also its orientation (a
vector defining the axis the mesh is looking at), so at each frame It
should be possible to define a new navigationData.
When I try to set the navigation data, the position is correctly
placed using *SetPosition(mitk::Point3D) *but I am confused about the
orientation, as it is represented by a quaternion on the method of
*SetOrientation(mitk::Quaternion)*. How can I represent the
orientation in a quaternion given a direction vector or the axis the
mesh is aligned (let's say, (0.5,0.5,0))?
Thank you very much,
Albert.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
https://lists.sourceforge.net/lists/listinfo/mitk-users
Loading...