I'm trying to draw a quad on a 3D terrain under the mouse. To do this, I need to convert the mouse's window coordinates to world coordinates somehow. I Google'd the subject and found a bunch of tutorials, but they all talk about gluUnProject and legacy code. I'm using OpenGL 3.1. Is there any way to convert mouse coordinates to world coordinates without using legacy code?