So, I read this tutorial here:
http://content.gpwiki.org/index.php/OpenGL%3aTutorials%3aUsing_Quaternions_to_represent_rotation
and implemented the example camera at the end of the page.
I'll explain the problem.
The camera movement works fine, but the rotation is doing some weird stuff like flickering/flipping...
It looks like there are 3 different rotation matrices being generated from the quaternion, one is actually correct and the other two are flipped or black, or something else.
I'm just trying to pitch and yaw the camera on its local axis...
I've tried normalizing the quaternion before and after each function call but it's not the problem.
So anyone knows what might be wrong in this piece of code? According to the tutorial, it should be working, but I can't get it to work after some hours of research and code tweaking...
Thanks.