I'm trying to build a generic camera class (so just one class) that with few simple operators can allow one to create any type of high level camera.
I'd like to do it this way because I think that, then, switching for example between a first person and a trackball like camera will be easier.
For now I've successfully implemented the usual 1st person camera by defining few simple operators on the camera class and creating orientation using quaternions.
Operators/Methods:
moveXCameraRelative
moveYCameraRelative
rotateXCameraRelative
rotateYCameraRelative
The thing is that I can't figure out how to switch between (say) a 1st person and a trackball without screwing everything. What I mean is flying a bit with a 1st person and then from that exact pov switch to trackball and use it and then back to 1st person transparently (like in a DCC tool).
What I thought is that I should accumulate orientations etc. but I guess that my current method is not very correct because instead of accumulating orientations deltas I accumulate the angle and calculate the orientation of accumulated angles instead of defining an offset quaternion. I saw some implementation they do something like:
Quaternion q(axis,delta) //the offset quaternion (relative rotation quaternion)
I do something like:
angle += delta;
Quaternion q(axis,angle); //the absolute rotation quaternion
should I use the first solution and accumulate quaternions instead of accumulate the absolute angle to have the possibility to implement the behaviour that I described before
Thanks in advance for your help



Find content
Not Telling
Display name history

