I have written a PID controller that regulate a Roll angle inside a game engine (using euler coordinates), and it works fine when used "upright".

But as soon as my object goes inverted or points in another direction, the roll values switch places with the pitch or even becomes inverted.

I've tried filtering out the effects of the other axis by getting the Right vector of the object (a normalized vector that points to the objects right) then unrotate this vector by my final Euler rotation, but omitting the roll axis.(which gave me great results by filtering the yaw, but the pitch still does invert my roll)

(I only want to get the roll axis value, without the other axis influencing/reversing it)

I'm currently trying to understand how quaternions work but I'm not sure if I'm heading in the right direction. Any suggestions? :)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.