I've been working on a 3d graphics app for a while, and I've been utilizing a camera class (gleaned from here and elsewhere) to provide the mouse/keyboard pan/zoom/rotate functionality.
It uses gluPerspective+gluLookAt to provide the transformations, and it's worked fairly well (other than an annoying orientation "flip" during some zoom factors).
However, for other reasons, I need to switch to a parallel projection (i.e. glOrtho + gluLookAt) and:
1) For the life of me, I can't get it to work right.
2) Spent all day searching, and I can't find any examples anywhere (everybody these days uses perspective!)
I would be so grateful if someone would please put me out of my misery and show me where I can find a good working example (no gimble lock, handles large and small near/far values, etc.), suitable for someone who is severely linear algebra challenged...
Quaternions aren't enough, you have to avoid using Eulerian transforms which is easier with quaternions. Otherwise, you have to treat some special cases, the singularities on poles.
Using quaternions sounds like a good implementation strategy.
Does anyone know where it's been utilized for a JOGL camera class (parallel projection)?
It must have already been invented many times by many people...just can't find one!
(Think CAD viewers)
Another common way to handle the camera is by defining it through 3 vectors (up, forward, right for example). There is no gimbal lock since there are no angles stored but leaves some more calculations to the user of the camera to turn it around et c