• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# KinectGestures类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中KinectGestures的典型用法代码示例。如果您正苦于以下问题:C# KinectGestures类的具体用法?C# KinectGestures怎么用?C# KinectGestures使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KinectGestures类属于命名空间,在下文中一共展示了KinectGestures类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GestureCompleted

    public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectInterop.JointType joint, Vector3 screenPos)
    {
        //string sGestureText = gesture + " detected";
        //if(GestureInfo != null)
        //{
        //	GestureInfo.guiText.text = sGestureText;
        //}

        if (gesture == KinectGestures.Gestures.Squat) {
            int num = 0;
            Camera.main.transform.SendMessage ("ActionPerformed",num);
        }
        else if (gesture == KinectGestures.Gestures.Jump) {

            Camera.main.transform.SendMessage ("ActionPerformed",1);
        }
        else if (gesture == KinectGestures.Gestures.Wave) {
            Camera.main.transform.SendMessage ("ActionPerformed",2);
        }
        else if (gesture == KinectGestures.Gestures.RaiseLeftHand) {
            Camera.main.transform.SendMessage ("ActionPerformed",3);
        }
        else if (gesture == KinectGestures.Gestures.RaiseRightHand) {
            Camera.main.transform.SendMessage ("ActionPerformed",4);
        }

        return true;
    }
开发者ID:iEmily,项目名称:HeartHealthKinect,代码行数:29,代码来源:SimonSaysListener.cs


示例2: GestureInProgress

    public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture, 
		float progress, JointType joint, Vector3 screenPos)
    {
        //GestureInfo.guiText.text = string.Format("{0} Progress: {1:F1}%", gesture, (progress * 100));
        //		if(gesture == KinectGestures.Gestures.Click && progress > 0.3f)
        //		{
        //			string sGestureText = string.Format ("{0} {1:F1}% complete", gesture, progress * 100);
        //			if(GestureInfo != null)
        //				GestureInfo.guiText.text = sGestureText;
        //
        //			progressDisplayed = true;
        //		}
        //		else
        if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} detected, zoom={1:F1}%", gesture, screenPos.z * 100);
            if(GestureInfo != null)
                GestureInfo.guiText.text = sGestureText;

            progressDisplayed = true;
        }
        else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} detected, angle={1:F1} deg", gesture, screenPos.z);
            if(GestureInfo != null)
                GestureInfo.guiText.text = sGestureText;

            progressDisplayed = true;
        }
    }
开发者ID:hazlett,项目名称:Parkinsons,代码行数:30,代码来源:MinecartGestureListener.cs


示例3: GestureInProgress

    public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              float progress, KinectInterop.JointType joint, Vector3 screenPos)
    {
        // the gestures are allowed for the primary user only
        KinectManager manager = KinectManager.Instance;
        if(!manager || (userId != manager.GetPrimaryUserID()))
            return;

        // this function is currently needed only to display gesture progress, skip it otherwise
        if(gestureInfo == null)
            return;

        if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} {1:F0}%", gesture, screenPos.z * 100f);
            gestureInfo.GetComponent<GUIText>().text = sGestureText;

            progressDisplayed = true;
            progressGestureTime = Time.realtimeSinceStartup;
        }
        else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} {1:F0} degrees", gesture, screenPos.z);
            gestureInfo.GetComponent<GUIText>().text = sGestureText;

            //Debug.Log(sGestureText);
            progressDisplayed = true;
            progressGestureTime = Time.realtimeSinceStartup;
        }
    }
开发者ID:turn-135,项目名称:Kinect_Test,代码行数:30,代码来源:GestureListener.cs


示例4: GestureCompleted

    public bool GestureCompleted(uint userId, int userIndex, KinectGestures.Gestures gesture,
								 KinectWrapper.NuiSkeletonPositionIndex joint, Vector3 screenPos)
    {
        string sGestureText = gesture + " detected";
        if(GestureInfo != null)
        {
            GestureInfo.guiText.text = sGestureText;
        }
          	if(gesture == KinectGestures.Gestures.SwipeLeft)
          	{
            swipeLeft = true;
          	}
        if(gesture == KinectGestures.Gestures.SwipeRight)
        {
            swipeRight = true;
        }
        if(gesture == KinectGestures.Gestures.SwipeUp)
        {
          swipeUp = true;
        }
        if(gesture == KinectGestures.Gestures.SwipeDown)
        {
          swipeDown = true;
        }
        if(gesture == KinectGestures.Gestures.Push)
        {
          push = true;
        }
        if(gesture == KinectGestures.Gestures.Pull)
        {
          pull = true;
        }

          return true;
    }
开发者ID:songwanfu,项目名称:MotionSensing3DSolarSystem,代码行数:35,代码来源:GestureListener1.cs


示例5: GestureCompleted

    public bool GestureCompleted(uint userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectWrapper.NuiSkeletonPositionIndex joint, Vector3 screenPos)
    {
        string sGestureText = gesture + " detected";
        if (gesture == KinectGestures.Gestures.Click) {
            sGestureText += string.Format (" at ({0:F1}, {1:F1})", screenPos.x, screenPos.y);
            print ("CLICKED DOWN???!?!?!?!?!");	//reverse units
            print ("SCREEN POS: " + screenPos);
            clickedPos.x = screenPos.x;
            clickedPos.y = screenPos.y;
            GetComponent<LineGame> ().kinectClickedOn = true;
            GetComponent<LineGame> ().clickedPos = clickedPos;
            GetComponent<Main> ().kinectClickedOn = true;
            GetComponent<Main> ().clickedPos = clickedPos;
            GetComponent<GrowingTeamGame> ().kinectClickedOn = true;
            GetComponent<GrowingTeamGame> ().clickedPos = clickedPos;
            GetComponent<AquariumGame> ().kinectClickedOn = true;
            GetComponent<AquariumGame> ().clickedPos = clickedPos;
        }

        if(GestureInfo != null)
            GestureInfo.GetComponent<GUIText>().text = sGestureText;

        progressDisplayed = false;

        return true;
    }
开发者ID:EECS481AquaTeam,项目名称:Aquarium,代码行数:27,代码来源:SimpleGestureListener.cs


示例6: GestureInProgress

    public void GestureInProgress(uint userId, int userIndex, KinectGestures.Gestures gesture, 
	                              float progress, KinectWrapper.NuiSkeletonPositionIndex joint, Vector3 screenPos)
    {
        //GestureInfo.guiText.text = string.Format("{0} Progress: {1:F1}%", gesture, (progress * 100));
        if(gesture == KinectGestures.Gestures.Click && progress > 0.3f)
        {
            string sGestureText = string.Format ("{0} {1:F1}% complete", gesture, progress * 100);
            if(GestureInfo != null)
                GestureInfo.GetComponent<GUIText>().text = sGestureText;

            progressDisplayed = true;
        }
        else if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} detected, zoom={1:F1}%", gesture, screenPos.z * 100);
            if(GestureInfo != null)
                GestureInfo.GetComponent<GUIText>().text = sGestureText;

            progressDisplayed = true;
        }
        else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} detected, angle={1:F1} deg", gesture, screenPos.z);
            if(GestureInfo != null)
                GestureInfo.GetComponent<GUIText>().text = sGestureText;

            progressDisplayed = true;
        }
    }
开发者ID:PC-Yolger,项目名称:Tesis-de-Grado---Unity-and-Kinect,代码行数:29,代码来源:SimpleGestureListener.cs


示例7: GestureCompleted

    //Virtual override of KinectGestures.GestureListenerInterface.GestureCompleted
    //Once completed a gesture propogate the gesture to the GestureNavigationMenu
    public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                             KinectInterop.JointType joint, Vector3 screenPos)
    {
        string sGestureText = gesture + " detected";

        if(GestureInfo != null)
        {
            GestureInfo.text = sGestureText;
        }
        //depending on which gesture is performed, call the relevant function in the GestureNavigationMenu
        switch (gesture) {
        case KinectGestures.Gestures.SwipeUp:
            menu.SwipeUp();
            break;
        case KinectGestures.Gestures.SwipeDown:
            menu.SwipeDown();
            break;
        case KinectGestures.Gestures.SwipeLeft:
            menu.SwipeLeft();
            break;
        case KinectGestures.Gestures.SwipeRight:
            menu.SwipeRight();
            break;
        default:
            break;
                }

        progressDisplayed = false;

        return true;
    }
开发者ID:monodavids,项目名称:Unity3dKinectNavigation,代码行数:33,代码来源:GestureListener.cs


示例8: GestureCancelled

    /// <summary>
    /// Invoked if a gesture is cancelled.
    /// </summary>
    /// <returns>true</returns>
    /// <c>false</c>
    /// <param name="userId">User ID</param>
    /// <param name="userIndex">User index</param>
    /// <param name="gesture">Gesture type</param>
    /// <param name="joint">Joint type</param>
    public bool GestureCancelled(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectInterop.JointType joint)
    {
        // the gestures are allowed for the primary user only
        KinectManager manager = KinectManager.Instance;
        if(!manager || (userId != manager.GetPrimaryUserID()))
            return false;

        if(gesture == KinectGestures.Gestures.LeanLeft)
        {
            leanLeft = false;
        }
        else if(gesture == KinectGestures.Gestures.LeanRight)
        {
            leanRight = false;
        }
        else if(gesture == KinectGestures.Gestures.Wheel)
        {
            wheel = false;
        }

        if(gestureInfo != null && progressDisplayed)
        {
            progressDisplayed = false;
            gestureInfo.GetComponent<GUIText>().text = "Lean-left, Lean-right to rotate the Room.";
        }

        return true;
    }
开发者ID:merlinsaw,项目名称:diplom,代码行数:38,代码来源:RoomGestureListener.cs


示例9: GestureCompleted

    public bool GestureCompleted(uint userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectWrapper.NuiSkeletonPositionIndex joint, Vector3 screenPos)
    {
        if (gesture == KinectGestures.Gestures.SwipeLeft && Cart.scene2) {
            Debug.Log("Swipe Left Completed!");
            GameObject.FindObjectOfType<Shelf>().SwipeLeft();
        }

        if (gesture == KinectGestures.Gestures.SwipeRight && Cart.scene2) {
            //Debug.Log("Swipe Left Completed!");
            GameObject.FindObjectOfType<Cart>().SwipeRight();
            Debug.Log("Swipe Right Completed!");
        }

        string sGestureText = gesture + " detected";
        if(gesture == KinectGestures.Gestures.Click)
            sGestureText += string.Format(" at ({0:F1}, {1:F1})", screenPos.x, screenPos.y);

        if(GestureInfo != null)
            GestureInfo.GetComponent<GUIText>().text = sGestureText;

        progressDisplayed = false;

        return true;
    }
开发者ID:Evi91,项目名称:menu,代码行数:25,代码来源:SimpleGestureListener.cs


示例10: GestureCompleted

    public bool GestureCompleted(uint userId, int userIndex, KinectGestures.Gestures gesture, 
		KinectWrapper.SkeletonJoint joint, Vector3 screenPos)
    {
        KinectManager manager = KinectManager.Instance;
        string sGestureText = gesture + " detected";
        if(GestureInfo != null)
        {
            GestureInfo.guiText.text = sGestureText;
        }

        if (gesture == KinectGestures.Gestures.SwipeLeft)
            swipeLeft = true;
        else if (gesture == KinectGestures.Gestures.SwipeRight)
            swipeRight = true;
        //else if(gesture == KinectGestures.Gestures.RaiseLeftHand)
        //    RaiseLeftHand = true;
        //else if(gesture == KinectGestures.Gestures.RaiseRightHand)
        //    RaiseRightHand = true;
        else if (gesture == KinectGestures.Gestures.Push)
            Push = true;
        else if (gesture == KinectGestures.Gestures.Psi)
            PSI = true;
        else if (gesture == KinectGestures.Gestures.Wave)
            Wave = true;
        return true;
    }
开发者ID:jsnulla,项目名称:IFX,代码行数:26,代码来源:GestureListener.cs


示例11: GestureInProgress

    public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              float progress, KinectInterop.JointType joint, Vector3 screenPos)
    {
        /*if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} detected, zoom={1:F1}%", gesture, screenPos.z * 100);

            if(GestureInfo != null)
            {
                GestureInfo.text = sGestureText;
            }

            //Debug.Log(sGestureText);
            progressDisplayed = true;
        }
        else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} detected, angle={1:F1} deg", gesture, screenPos.z);

            if(GestureInfo != null)
            {
                GestureInfo.text = sGestureText;
            }

            //Debug.Log(sGestureText);
            progressDisplayed = true;
        }*/
    }
开发者ID:freddiehonohan,项目名称:HndCntrl,代码行数:28,代码来源:GestureListener.cs


示例12: GestureInProgress

    public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              float progress, KinectInterop.JointType joint, Vector3 screenPos)
    {
        if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} {1:F0}%", gesture, screenPos.z * 100f);
            if(GestureInfo != null)
            {
                GestureInfo.GetComponent<GUIText>().text = sGestureText;
            }

            progressDisplayed = true;
            progressGestureTime = Time.realtimeSinceStartup;
        }
        else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} {1:F0} deg.", gesture, screenPos.z);
            if(GestureInfo != null)
            {
                GestureInfo.GetComponent<GUIText>().text = sGestureText;
            }

            //Debug.Log(sGestureText);
            progressDisplayed = true;
            progressGestureTime = Time.realtimeSinceStartup;
        }
    }
开发者ID:juoni,项目名称:IndieGalacticSpaceJam,代码行数:27,代码来源:SimpleGestureListener.cs


示例13: GestureInProgress

    public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              float progress, KinectInterop.JointType joint, Vector3 screenPos)
    {
        // the gestures are allowed for the primary user only
        KinectManager manager = KinectManager.Instance;
        if(!manager || (userId != manager.GetPrimaryUserID()))
            return;

        if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} detected, zoom={1:F1}%", gesture, screenPos.z * 100);

            if(GestureInfo != null)
            {
                GestureInfo.GetComponent<GUIText>().text = sGestureText;
            }

            //Debug.Log(sGestureText);
            progressDisplayed = true;
        }
        else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
        {
            string sGestureText = string.Format ("{0} detected, angle={1:F1} deg", gesture, screenPos.z);

            if(GestureInfo != null)
            {
                GestureInfo.GetComponent<GUIText>().text = sGestureText;
            }

            //Debug.Log(sGestureText);
            progressDisplayed = true;
        }
    }
开发者ID:GuillaumeBiannic,项目名称:StageMaster,代码行数:33,代码来源:SimpleGestureListener.cs


示例14: GestureCompleted

 //KinectGestures.GestureListenerInterface virtual implementation
 public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture, 
                          KinectInterop.JointType joint, Vector3 screenPos)
 {
     string sGestureText = gesture + " detected";
     //Propogate the recognised gesture to the cursor controller
     if(cursor!=null)cursor.WaveRecognised();
     if(cursorDirect!=null)cursorDirect.WaveRecognised();
     return true;
 }
开发者ID:monodavids,项目名称:Unity3dKinectNavigation,代码行数:10,代码来源:UserDetector.cs


示例15: GestureCompleted

    public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                             KinectInterop.JointType joint, Vector3 screenPos)
    {
        if (activeGestures.ContainsKey(userId))
            activeGestures[userId].Enqueue(gesture);
        return true;
        // this true return will clear the gesture info, because once we've completed one gesture,
        // we assume that any others started at the same time were actually just misinterpretations.
    }
开发者ID:christuart,项目名称:Meet-EDSAC,代码行数:9,代码来源:MyKinectListener.cs


示例16: GestureCancelled

    public bool GestureCancelled(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectInterop.JointType joint)
    {
        // the gestures are allowed for the primary user only
        KinectManager manager = KinectManager.Instance;
        if(!manager || (userId != manager.GetPrimaryUserID()))
            return false;

        // don't do anything here, just reset the gesture state
        return true;
    }
开发者ID:mfppvl,项目名称:Kinect-vs-Autism-project-CSI,代码行数:11,代码来源:GestureListener.cs


示例17: GestureCompleted

    public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture, 
	    JointType joint, Vector3 screenPos)
    {
        if (gesture == KinectGestures.Gestures.RaiseRightHand)
        {
            StateManager.Instance.IsPlaying = true;
            StateManager.Instance.CurrentState = StateManager.State.PLAYING;
        }

        return true;
    }
开发者ID:hazlett,项目名称:Parkinsons,代码行数:11,代码来源:SimpleGestureListener.cs


示例18: GestureInProgress

    public void GestureInProgress(uint userId, int userIndex, KinectGestures.Gestures gesture, 
	                              float progress, KinectWrapper.NuiSkeletonPositionIndex joint, Vector3 screenPos)
    {
        if (gesture == KinectGestures.Gestures.SwipeLeft)
        {
            //Debug.Log("SwipeLeft " + progress + " Screen Pos: "+ screenPos + " Gesture: " + gesture);
        }
        if (gesture == KinectGestures.Gestures.SwipeRight)
        {
            //Debug.Log("SwipeRight " + progress + " Screen Pos: "+ screenPos + " Gesture: " + gesture);
        }
    }
开发者ID:Evi91,项目名称:menu,代码行数:12,代码来源:MineGestureListener.cs


示例19: GestureCompleted

    public bool GestureCompleted(uint userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectWrapper.NuiSkeletonPositionIndex joint, Vector3 screenPos)
    {
        string sGestureText = gesture + " detected";
        if(gesture == KinectGestures.Gestures.Click)
            sGestureText += string.Format(" at ({0:F1}, {1:F1})", screenPos.x, screenPos.y);

        if(GestureInfo != null)
            GestureInfo.GetComponent<GUIText>().text = sGestureText;

        progressDisplayed = false;

        return true;
    }
开发者ID:PC-Yolger,项目名称:Tesis-de-Grado---Unity-and-Kinect,代码行数:14,代码来源:SimpleGestureListener.cs


示例20: GestureCancelled

    public bool GestureCancelled(uint userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectWrapper.NuiSkeletonPositionIndex joint)
    {
        if(progressDisplayed)
        {
            // clear the progress info
            if(GestureInfo != null)
                GestureInfo.GetComponent<GUIText>().text = String.Empty;

            progressDisplayed = false;
        }

        return true;
    }
开发者ID:PC-Yolger,项目名称:Tesis-de-Grado---Unity-and-Kinect,代码行数:14,代码来源:SimpleGestureListener.cs



注:本文中的KinectGestures类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# KinectInterop类代码示例发布时间:2022-05-24
下一篇:
C# Kind类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap