• Advertisement
Sign in to follow this  

Removing gluLookAt()

This topic is 4846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Ahh, wow. awesome. Thanks guys! I will talk w/ my dev team and see what they think. We will probably go for glFrustum. Thanks!

Share this post


Link to post
Share on other sites
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.





Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement