Monday, October 31, 2022
HomeGame Development3d - How do I work with quaternions in replace()?

3d – How do I work with quaternions in replace()?


When working with rotations expressed as angles, it is sensible to have the ability do to one thing like

void GameLoop::replace(){
     pawn.rotation.x += 0.01;
}

And slowly watch the mannequin rotate. Nevertheless once I tried to do the identical factor with a Quaternion primarily based rotation, I noticed that the rotation didn’t behave as anticipated. For context I am utilizing GLM’s Quaternion implementation. What’s the greatest identified technique for updating and interacting with Quaternions? ought to I convert the Quat again to Euler angles, do the replace after which retailer the up to date worth, or is there a Quat analog to += 0.01 that’s thought-about normal? Am I incorrect for storing a mannequin’s rotation as a Quaternion within the first place?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments