samssonart's picture

Screen coordinates to Object coordinates without gluUnProject

I've been looking the forums and checked online tutorials, I want to know how can I convert screen coordinates to object coordinates, so I can draw objects using the mouse. I've seen many solutions to this, but all of them use the Glu.unproject function, which appears to be deprecated. So I want to know if anyone knows of another way to do this that won't rely on deprecated code.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
samssonart's picture

Thanks, I had seen that post already, what I meant is that the results that get out of gluUnProject are not reliable when using perspective projection, or maybe I just don't know how to properly use it, but results are weird. I want to know if anyone knows of another way to do screen-to-world-coordinates convertions.

XZibit's picture

In Fact you have to project your point as Vector through your current Matrices (Modelview & Projection) by using
Vector_Projection. This isnt anything else than UnProject do!