how to rotate the scene node by absolute quaternion value

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
henrymark11
Posts: 1
Joined: Sat Apr 15, 2017 7:57 am

how to rotate the scene node by absolute quaternion value

Post by henrymark11 »

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 :)
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: how to rotate the scene node by absolute quaternion valu

Post by CuteAlien »

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
Post Reply