Hi, I am a new in irrlicht, I am work on a project which can get the absolute quaternion value by the gyro, I have to rotate the scene node by the quaternion.
but now I have a issue ,the gyro gives the absolute quaternion value , it means the value is not releative to last quaternion value.
but in irrlicht the scene node rotate in the foundation of last rotation.
so I wonder anyone can help me to rotate the scene node by setRotation(const core::vector3df& rotation)
Thanks
how to rotate the scene node by absolute quaternion value
-
- Posts: 1
- Joined: Sat Apr 15, 2017 7:57 am
Re: how to rotate the scene node by absolute quaternion valu
Irrlicht does not add rotations to the last rotation. You set euler angles and those are used. Irrlicht's quaternion class has a toEuler function. Be aware that Irrlicht uses left-handed rotations (at least if you use a current Irrlicht version - if you use versions older than 1.8 there had been a mixup and quaternions had been right-handed unlike rest of Irrlicht). So make sure you know what the quaternions you get are using.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm