[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Camera thoughts

Steve Baker wrote:
> MAO wrote:
> >         I'm implementing a camera system using Euler angles, but I'm not sure
> > about one thing.
> Well, I certainly wouldn't use gluLookAt - it's OK for quick hack programs
> where you want to be sure you are looking at a particular model - but for
> more serious applications like games where you need to navigate an environment,
> I strongly suggest that you get familiar with the matrix representation for
> rotations.

	Hum, ok, I know the matrix form for all the basic transforms. So the
idea is, forget about gluLookAt and compose the MODELVIEW matrix on my
own? With the camera model I described, would that be replacing the GLU
function call by three glRotates (about the three camera axis) and one

> You should read my two FAQ's on this subject:
>   http://www.sjbaker.org/steve/omniv/matrices_can_be_your_friends.html
>   http://www.sjbaker.org/steve/omniv/eulers_are_evil.html

	Hehe, I read those :) Indeed, it was thanks to you that I got to
understand the problems with Eulers in the first place. Thanks.

> >         This seems to work fine, but if, for example, I pitch up, and start
> > just applying yaw repeatedly, I notice that the camera slowly starts
> > leveling, canceling the initial pitch.
> That's probably to do with the order that the yaw and pitch angles are
> applied.  My 'Eulers Are Evil' document explains this in some detail.

	I'll take a look at that, although I believe that I have experimented,
without success, exchanging the order of rotations from yaw, pitch to
pitch, yaw.

Thanks for your attention,
Miguel A. Osorio