If you want to store the camera as a point/quaternion pair, read on:
Rotation can be achieved by "setting" the 2 of the vectors via rotation (which is what you are doing) OR by multiplying by a matrix:
Lets say we represent the camera as a 4x4 matrix, eye_matrix_world, so that
position_in_eye= eye_matrix_world * position_in_world.
now to move we just multiple by a translation matrix:
eye_matrix_world <-- transalation_matrix * eye_matrix_world
where translation_matrix is 1's on diaganol and the last column holds the translation.... we can do rotating in a similar way as well:
eye_matrix_world <-- rotation_matrix * eye_matrix_world
now, to use quaternions, you need to break down how the translation is stored and such, one way is as follows:
A(p,q) := translate by vector p, then rotate by q.
[Note: the camera is at -p, not p, since the point -p in world co-ordinates gets mapped to 0 in eye-coordinates here].
So now rotating the camera is represented by a quaternion, R, so then the new pair is: A(p,Rq).
you will need to chase some algebra to grok what happens, but it is a worth while exercise, which is one reason why I left out how to "move the camera forward".
One nice bit is that rather than needing to re-orthogonalize you just need to normalize the quaternion, which is not so bad...
Note: a rotation be a quaternion is always orientation preserving!
Quote:
Anyway, I would say that this is a good example of why you should 'make games, not engines'
I would argue that understanding co-ordinate transformations is elementary enough that it is worth implementing once on your own, even if one uses a ready made engine... this is the theory forum:) Without this understanding the code and engine look like black magic and one does not understand why things are the way they are and what are the limitations for each....
out of morbid curiosity I did a google and got the link: http://scientificninja.com/advice/write-games-not-engines which has a point, but is kind of extreme, and in my eyes short sighted, what one learns in making such an engine is the goal often, and after the first try or 2, then the real design and understanding happen as well, lots of engines started as hobbyist projects, but it is just someone's blog....