Page 1 of 1

how to rotate the scene node by absolute quaternion value

Posted: Sat Apr 15, 2017 8:09 am
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 :)

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

Posted: Sun Apr 16, 2017 1:35 pm
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.