Unity kinect坐标 转 屏幕坐标

   if (_manager  _manager.IsInitialized()  _manager.IsUserDetected())
        {
            foreach (var item in _manager.GetAllUserIds())
            {
                // 追踪当前用户骨骼
                if (_manager.IsJointTracked(item, 3))
                {
                    Vector3 HeadPos = _manager.GetJointKinectPosition(item, 3);
                    Vector3 ScreenHeadPos = Camera.main.WorldToScreenPoint(HeadPos);
                    Vector2 screenPoint = new Vector2(ScreenHeadPos.x, ScreenHeadPos.y);
                    Vector2 uiPos;
                    RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRectTransform, screenPoint, Camera.main, out uiPos);
                    Debug.Log(uiPos);

                }
            }
        }

 

最新回复(0)
/jishuc43qC6ctLBBDnbZslxqoeA7ZPdP6bXaJTF59LKG_2BDMc_3D4680641
8 简首页