Sign in to follow this  
Ace826

Removing gluLookAt()

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
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 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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this