Re: Camera Management



Nicholas wrote:

> This sounds like it might have a very simple solution. Store the
> accumulated angle of rotation, and rotate the original forward/up
> vectors by that angle, rather than rotating the already rotated vectors
> by the incremental angle.

A large number of problems arose when I tried maintaining rotation angles
rather than using just vectors. One of them is that an object (such as the
camera) can go through a large number of arbitrary transformations to
arrive at its final orientation. Angles have to be converted to vectors at
some point anyway for many operations, so it makes sense to use vectors
throughout. Vector math up to this point has been very easy to work with,
so I'll stick with them.

I don't know of any way to represent camera orientation with simple angles
without using Quaternions, an approach I tried and abandoned in favor of
matrices. Matrices are many times simpler to use, and Quaternions have to
be converted to Matrices anyway in order for OpenGL to use their results.
Quaternion math is also ridiculously complicated compared to matrix math.

The problem should be solved by taking a couple cross products periodically
to regenerate the up vector:

left = forward x up
up = forward x left (or left x forward; I'll figure out which)

Thanks for the response. :)

.



Relevant Pages