Removing gluLookAt()

Started by
8 comments, last by Ace826 19 years, 5 months ago
I was wondering if there are any good sites that talk about creating camera views w/o the use of gluLookAt(). I am trying to create my game without the glut library. Any sites that talk about how this would be done through the just gl.h, glaux.h, and glu.h And, is glu and glut different? Thanks.
Advertisement
glu is different from glut. So you don't need glut to use gluLookAt. If you want to create your own camera or applications without glut, then here are a few sites that might be of some interest:

www.gametutorials.com
www.opengl.org
nehe.gamedev.net
Thank you. :)
Bitmap loaders are easy, DONT USE GLAUX!

The opengl auxiliary library(glaux) was made by sgi in 1996 to make small applications, it is leaky(??36?? memory leaks total) slow, and bugy, it is also depricated(being unupdated for 9 years). Just stear clear of it.
if you want to know how gluLookAt is implemented you can download the Mesa3D source code and take a look at the gluLookAt implementation.

HTH

Thanks guys. Awesome info. I didn't know that about glaux. I will try and remove it from my code.... if i have used it at all.
If you really don't want to use gluLookat, then you could use glFrustum (notice there is only one 'r', not two as in the non-word "Frustrum" that people erroneously use).

glFrustum (opengl blue book)

it differs from gluLookAt in that you are specifically defining the view volume of the scene. gluLookAt gives you nowhere near the control that glFrustum does. However, that means it's also much more difficult to use.

you may want to try fiddling around with gluPerspective for a while before using glFrustum. Again, it does the same job as gluLookAt, but uses a different approach that will prepare you better for using glFrustum.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Ahh, wow. awesome. Thanks guys! I will talk w/ my dev team and see what they think. We will probably go for glFrustum. Thanks!
Quote:
it differs from gluLookAt in that you are specifically defining the view volume of the scene. gluLookAt gives you nowhere near the control that glFrustum does. However, that means it's also much more difficult to use.


Sorry to contradict you, but you're way off base here. glFrustum will define your projection ie. how your view-space geometry will be projected onto the view-plane. It will do no view-transforms (ie. camera transforms) for you.

If you want to do view transforms, you will have to use either
* gluLookAt(),
* glRotatef(), glTranslatef()
or
* glMultMatrixf()
or
* a combination of the 3 above methods.

There is no way to use pure glFrustum to do this.

Ace826...As for me, I would calculate my camera vectors (ie. right vector, up vector, at vector and pos vector), stuff them in a matrix with some swizzling and negations, and transform using glMultMatrixf(). Ace, if you're interested I could post the matrix code that I use here later. I don't have it on me at the moment.





do unto others... and then run like hell.
Sure. That would be great! I just need to get an idea or two.

This topic is closed to new replies.

Advertisement