When you want to convert 2d-to-3d you need to set the Z value. The function that has been posted above is from BlitzSupport from the code archives, so it takes the screen x,y parameters and put the object in front of the camera so the object is in the same x,y to the given point and the Z is selected to the needed value.
Try it for yourself positioning an object in the x,y mouse values. Very nice code!
P.D: It doesn't work with ortographic projection (as lot of things that don't work neither).
Try it for yourself positioning an object in the x,y mouse values. Very nice code!
P.D: It doesn't work with ortographic projection (as lot of things that don't work neither).