Skip to main content
GameDev.net gamedev.net
🔒 Locked

Quaternion Normalization

Started by Endemoniada Mar 9, 2008 at 3:43 PM 0 replies 2.5k views
Original Post
Endemoniada
Endemoniada
Hi guys, I'm using quaternions for rotation; do I have to normalize after each rotation ? Like this: void Rotate() { RotateXAxis(D3DXQUATERNION* pOrientation,float fAngle); // normalize here ? RotateYAxis(D3DXQUATERNION* pOrientation,float fAngle); // normalize here ? } or maybe like this: void Rotate() { RotateXAxis(D3DXQUATERNION* pOrientation,float fAngle); RotateYAxis(D3DXQUATERNION* pOrientation,float fAngle); // normalize at end ? } I tested it and even tried no normalization and didn't notice a difference. Thanks.
Vorpy
Vorpy
You don't need to normalize after every rotation. After very many multiplications, there can be some drift, so depending on what you're doing you may need to normalize the quaternion at some point. For example, if you're using quaternions to track object orientations, you may want to normalize them once per frame, or something like that. If you're only using quaternions for temporary calculations and then converting to another representation, there's no need for normalization. It takes a lot of multiplications to cause a significant drift.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.