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

Am 28.02.2017 14:35, schrieb 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
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to