boombatower
06-13-2007, 03:18 PM
DoubleBuffer model = DoubleBuffer.allocate(16);
gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, model);
DoubleBuffer proj = DoubleBuffer.allocate(16);
gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, proj);
IntBuffer view = IntBuffer.allocate(4);
gl.glGetIntegerv(GL.GL_VIEWPORT, view);
DoubleBuffer winPos = DoubleBuffer.allocate(3);
glu.gluProject(x, y, z, model, proj, view, winPos);
Everywhere else I see this it works, but for me it doesn't. I get something that is [(same as object's x), 1024, 3]
Example matrices that OpenGL is returning:
MODELVIEW_MATRIX:
[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0]
PROJECTION_MATRIX
[0.0015625000232830644, 0.0, 0.0, 0.0, 0.0, -0.001953125, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, -1.0, 1.0, -0.0, 1.0]
VIEWPORT
[0, 0, 1280, 1024]
I am using Java and JOGL. Any suggestions on how to debug this?
gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, model);
DoubleBuffer proj = DoubleBuffer.allocate(16);
gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, proj);
IntBuffer view = IntBuffer.allocate(4);
gl.glGetIntegerv(GL.GL_VIEWPORT, view);
DoubleBuffer winPos = DoubleBuffer.allocate(3);
glu.gluProject(x, y, z, model, proj, view, winPos);
Everywhere else I see this it works, but for me it doesn't. I get something that is [(same as object's x), 1024, 3]
Example matrices that OpenGL is returning:
MODELVIEW_MATRIX:
[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0]
PROJECTION_MATRIX
[0.0015625000232830644, 0.0, 0.0, 0.0, 0.0, -0.001953125, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, -1.0, 1.0, -0.0, 1.0]
VIEWPORT
[0, 0, 1280, 1024]
I am using Java and JOGL. Any suggestions on how to debug this?