Jump to content
  • Advertisement
Sign in to follow this  

gluProject - Problem

This topic is 3482 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!