坐标转换

2020-03-10  本文已影响0人  APP4x

世界空间 如何转换为 屏幕空间?

 public static Vector3 World2Screen(Vector3 worldpos)
 {
     Vector3 result = 你的相机.WorldToViewportPoint(worldpos);
     result = new Vector3(你屏幕的宽度 * result.x, (float)GameLogic.Height * result.y, 0f);
     return result;
 }
上一篇下一篇

猜你喜欢

热点阅读