http://imageshack.us...51/65739345.png
My plan is to use the intersect point:
http://imageshack.us...76/55634161.png
and then create the ray from that point to the intersect point. Ive tried this:
public static Vector3 ScreenPositionToWorldPoint(Matrix View, Matrix Projection, Matrix World,IntVector2 MousePos)
{
Vector3 nearSource = new Vector3((float)MousePos.x, (float)MousePos.y, 0f);
Vector3 nearPoint = gGlobal.Device.Viewport.Unproject(nearSource, Projection, View, World);
return nearPoint;
}
But the vector3 returned isn't the correct number. For instance, if the player is standing at 10,0,10 then that will return 9.999, 0.00123, 9.9999. Thats with the viewport being 800x600 and sending that as the mouse position.
Anyone have a clue how to do this or an alternate way?
Edited by Oblivion165, 16 October 2012 - 03:48 AM.






