GLULookAt - Alternative implementations?

Started by MattCa, August 27, 2012, 23:48:11

Previous topic - Next topic

MattCa

Hey guys,
I'm working on moving up to OpenGL 3.2+, and due to the slimmed down API, I have to handle the projection, view and model matrices my self.
However, one of the functions that I commonly use, gluLookAt, does not return a Matrix4f object, and I believe only works with the in-built OpenGL matrices (I could be wrong?)

Does anyone have an implementation of the lookAt function laying around that returns an LWJGL Matrix4f? I've tried converting over Mesa3D's version, but the difference in APIs is a little confusing when you're this tired  :-\ .

Thanks for the help,
Matt.

Eternity

What I did was copy the gluLookAt method straight from the lwjgl source code (along with everything it depended on) and then modify it to return a Matrix4. All the glu methods are implemented in lwjgl. The gl methods rely on the driver so to implement things like glFrustum and glOrtho you should look at the opengl red book.