Sign in to follow this  
tito

gluProject - Problem

Recommended Posts

I have function where i wanna map points to screen-coords, but i am always getting zero in the coords-array out auf gluProject. Here is the code: ========================= DoubleBuffer Modelview = DoubleBuffer.allocate(16); DoubleBuffer Projection = DoubleBuffer.allocate(16); IntBuffer Viewport = IntBuffer.allocate(4); gl.glGetDoublev( gl.GL_MODELVIEW_MATRIX, Modelview); gl.glGetDoublev( gl.GL_PROJECTION_MATRIX, Projection); gl.glGetIntegerv( gl.GL_VIEWPORT, Viewport ); DoubleBuffer winpos = DoubleBuffer.allocate(3); System.out.println("x: " + x + " | y: "+ y +" | z: " + z); double in_x = (double)x; double in_y = (double)y; double in_z = (double)z; System.out.println("(in double) x: " + in_x + " | y: "+ in_y +" | z: " + in_z); glu.gluProject(in_x, in_y, in_z, Modelview, Projection, Viewport, winpos); ================================= I can't figure out what i am doing wrong. the var winpos.array()[0], winpos.array()[1], winpos.array()[2] is always giving me zero.. tia && greetings tito

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