0

I am writing camera class for opengl and use glm for maths calculations . I use quaternions for camera orientation. I get quaternions through glm:: angleaxis. Now i am writing a function to look at point from camera position. I need to get rotation for my camera, so i found two options: use glmllookat(pos,point,vec3(0,1,0)) and converting result matrix to quaternions or use glm::quatlookat to get quaternions for rotation. But in both cases there is a gimbal lock, so i can't get proper orientation for looking upsidedown (from pos (0,3,0) to (0,0,0) for example) and further than +-90 degrees. Is there any way to get proper orientation avoiding gimbal lock and getting orientation for looking from any point to anywhere? I found and idea about alternate up vector when front == up but what vector should it be?

Bitonists
  • 11
  • 3

0 Answers0