Is there a good reason to not use gluLookAt()?

Is it more expensive to use gluLookAt() than some other approach such as rotating and translating the scene? For aruguments sake let’s say the situation is a FPS or Dungeon Seige type deal.

I imagine it’ll be a while before I have to worry about it, but I’m curious :slight_smile:

Thanks

even if glulookat is 100 times more expensive than gltranslatef, it will still need only 0.1% of your rendering time.

In the C/C++ world there some prefer to avoid linking to the glu lib. For the most part, there are very few functions that are useful to mose games. gluPerspective, gluOrtho2D, and gluLookAt are the most common, and implementing a custom implementation of each is simple.

Since JOGL loads glu anyway, there’s no reason I can think of not to use gluLookAt.

OK, sounds good.

GluLookAt() produces a camera twist at the topmost position of the camera, thus some people prefer to postmultiply the modelview matrix with their own matrix which can avoid the problem, but this is not an easy exercise : it requires a good linear algebra knowledge.