Question

I am unsure as to how the GLU class works with GL3 and higher using a programmable pipeline. I have seen a couple of examples (jogl+GL3 examples seem scarce) that have code like the following:

GL3 gl = glAutoDrawable.getGL().getGL3();
glu.gluPerspective(80.0f, 1920.0f / 1080.0f, 0.1f, 100f);

glu.gluPerspective(...) doesn't return anything, so how do I access the calculated projectionMatrix to pass it into the shader? Similarly for gluLookAt(...). If these are made available in the shader as a default attribute what do I use for things like picking algorithms, where I need to create a vector based on the camera position?

Was it helpful?

Solution

If you're talking about core-profile OpenGL... you don't. You have to stop using GLU and start using an actual vector/matrix library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top