08/01/27 18:32:52 uw/hNxBV
遅いを通り越して、C'NKY
ここの
URLリンク(creators.xna.com)
CalculateCursorRay()って函数にそのものズブリがあった。
Positionは(0,0)~(853,480)のウィンドウ上の2次元座標な。
Vector3 nearSource = new Vector3(Position, 0f);
Vector3 farSource = new Vector3(Position, 1f);
Vector3 nearPoint = GraphicsDevice.Viewport.Unproject(nearSource,
projectionMatrix, viewMatrix, Matrix.Identity);
Vector3 farPoint = GraphicsDevice.Viewport.Unproject(farSource,
projectionMatrix, viewMatrix, Matrix.Identity);