Making a function that takes the x, y of the mouse and shoots a ray forward to return a position under the cursor in world space. I've followed many examples of how to do exactly this, but never able to get the correct result.
My most recent attempt I call the DirectX unproject twice ( [mouse.x, mouse.y, 0.0] - first pass, [mouse.x, mouse.y, 1.0] - second pass), and then I project forward in world space from the directional vector of these two. Has anyone had similar experience with making a screen to world function that can offer a recipe or pseudo code. I'm going crazy after several days of non-stop trying to figure this out. Thanks.