Kinect提取骨骼数据---新版本

来源:互联网 发布:sql select where and 编辑:程序博客网 时间:2024/06/04 17:58

此次更新改善了之前的无法单独确定一个人,此次更新可每个人完全分开,进入退出每个人都是独立状态。

此次更新是建立在之前的基础上,看不懂请转我的另一片文章,一些前面的定义是什么的都在另一篇文章中。




if (UserID1 == -1 && UserID2 != ID && UserID3 != ID && UserID4 != ID && UserID5 != ID && UserID6 != ID                                && body.HandLeftState == HandState.Closed                                && body.HandRightState == HandState.Closed                                && joints[(JointType)1].Position.Y < joints[(JointType)7].Position.Y                                && joints[(JointType)1].Position.Y < joints[(JointType)11].Position.Y)                            {                                UserID1 = ID;                                Warning.Text = "用户1进入体感控制";                            }                            else if (UserID1 != ID && UserID2 == -1 && UserID3 != ID && UserID4 != ID && UserID5 != ID && UserID6 != ID                                && body.HandLeftState == HandState.Closed                                && body.HandRightState == HandState.Closed                                && joints[(JointType)1].Position.Y < joints[(JointType)7].Position.Y                                && joints[(JointType)1].Position.Y < joints[(JointType)11].Position.Y)                            {                                UserID2 = ID;                                Warning.Text = "用户2进入体感控制";                            }                            else if (UserID1 != ID && UserID2 != ID && UserID3 == -1 && UserID4 != ID && UserID5 != ID && UserID6 != ID                                && body.HandLeftState == HandState.Closed                                && body.HandRightState == HandState.Closed                                && joints[(JointType)1].Position.Y < joints[(JointType)7].Position.Y                                && joints[(JointType)1].Position.Y < joints[(JointType)11].Position.Y)                            {                                UserID3 = ID;                                Warning.Text = "用户3进入体感控制";                            }                            else if (UserID1 != ID && UserID2 != ID && UserID3 != ID && UserID4 == -1 && UserID5 != ID && UserID6 != ID                                && body.HandLeftState == HandState.Closed                                && body.HandRightState == HandState.Closed                                && joints[(JointType)1].Position.Y < joints[(JointType)7].Position.Y                                && joints[(JointType)1].Position.Y < joints[(JointType)11].Position.Y)                            {                                UserID4 = ID;                                Warning.Text = "用户4进入体感控制";                            }                            else if (UserID1 != ID && UserID2 != ID && UserID3 != ID && UserID4 != ID && UserID5 == -1 && UserID6 != ID                                && body.HandLeftState == HandState.Closed                                && body.HandRightState == HandState.Closed                                && joints[(JointType)1].Position.Y < joints[(JointType)7].Position.Y                                && joints[(JointType)1].Position.Y < joints[(JointType)11].Position.Y)                            {                                UserID5 = ID;                                Warning.Text = "用户5进入体感控制";                            }                            else if (UserID1 != ID && UserID2 != ID && UserID3 != ID && UserID4 != ID && UserID5 != ID && UserID6 == -1                                && body.HandLeftState == HandState.Closed                                && body.HandRightState == HandState.Closed                                && joints[(JointType)1].Position.Y < joints[(JointType)7].Position.Y                                && joints[(JointType)1].Position.Y < joints[(JointType)11].Position.Y)                            {                                UserID6 = ID;                                Warning.Text = "用户6进入体感控制";                            }

原创粉丝点击