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

C# KinectInterop类代码示例

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

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



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

示例1: GestureInProgress

	public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              float progress, KinectInterop.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:ly774508966,项目名称:IUILab_Lecture_KinectAndOculusWithUnity3D,代码行数:30,代码来源:SimpleGestureListener.cs


示例2: 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


示例3: 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


示例4: 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


示例5: 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


示例6: 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


示例7: Init

    // Initialize the filter with a set of TransformSmoothParameters.
    public void Init(KinectInterop.SmoothParameters smoothParameters)
    {
        this.smoothParameters = smoothParameters;

        this.Reset();
        this.init = true;
    }
开发者ID:drfuzzyness,项目名称:WearHax-OlivMatt,代码行数:8,代码来源:JointPositionsFilter.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: 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


示例10: 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


示例11: 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


示例12: 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


示例13: CloseSensor

    public void CloseSensor(KinectInterop.SensorData sensorData)
    {
        if(coordMapper != null)
        {
            coordMapper = null;
        }

        if(bodyFrameReader != null)
        {
            bodyFrameReader.Dispose();
            bodyFrameReader = null;
        }

        if(bodyIndexFrameReader != null)
        {
            bodyIndexFrameReader.Dispose();
            bodyIndexFrameReader = null;
        }

        if(colorFrameReader != null)
        {
            colorFrameReader.Dispose();
            colorFrameReader = null;
        }

        if(depthFrameReader != null)
        {
            depthFrameReader.Dispose();
            depthFrameReader = null;
        }

        if(infraredFrameReader != null)
        {
            infraredFrameReader.Dispose();
            infraredFrameReader = null;
        }

        if(multiSourceFrameReader != null)
        {
            multiSourceFrameReader.Dispose();
            multiSourceFrameReader = null;
        }

        if(kinectSensor != null)
        {
            if (kinectSensor.IsOpen)
            {
                kinectSensor.Close();
            }

            kinectSensor = null;
        }
    }
开发者ID:tommyfriday,项目名称:SensorySteps,代码行数:53,代码来源:Kinect2Interface.cs


示例14: GestureCompleted

	public bool GestureCompleted (long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectInterop.JointType 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.guiText.text = sGestureText;
		
		progressDisplayed = false;
		
		return true;
	}
开发者ID:ly774508966,项目名称:IUILab_Lecture_KinectAndOculusWithUnity3D,代码行数:14,代码来源:SimpleGestureListener.cs


示例15: 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;
        }

        progressDisplayed = false;

        return true;
    }
开发者ID:freddiehonohan,项目名称:HndCntrl,代码行数:14,代码来源:SimpleGestureListener.cs


示例16: GestureCompleted

    public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectInterop.JointType joint, Vector3 screenPos)
    {
        if(progressDisplayed)
            return true;

        string sGestureText = gesture + " detected";
        if(GestureInfo != null)
        {
            GestureInfo.GetComponent<GUIText>().text = sGestureText;
        }

        return true;
    }
开发者ID:juoni,项目名称:IndieGalacticSpaceJam,代码行数:14,代码来源:SimpleGestureListener.cs


示例17: GestureCancelled

    public bool GestureCancelled(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectInterop.JointType joint)
    {
        if(progressDisplayed)
        {
            progressDisplayed = false;

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

        return true;
    }
开发者ID:juoni,项目名称:IndieGalacticSpaceJam,代码行数:15,代码来源:SimpleGestureListener.cs


示例18: GestureCompleted

    public bool GestureCompleted(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectInterop.JointType joint, Vector3 screenPos)
    {
        // squat gesture is detected
        if (gesture == KinectGestures.Gestures.Squat) {
            SquatNum++;
            Camera.main.transform.SendMessage ("SquatPerformed");
        }
        // jump or jumping jack gesture is detected
        else if (gesture == KinectGestures.Gestures.Jump) {
            JumpNum++;
            Camera.main.transform.SendMessage ("JumpPerformed");
        }

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


示例19: GestureCancelled

    public bool GestureCancelled(long userId, int userIndex, KinectGestures.Gestures gesture, 
                             KinectInterop.JointType joint)
    {
        //	if(progressDisplayed)
        //	{
        //		// clear the progress info
        //		if(GestureInfo != null)
        //		{
        //			GestureInfo.guiText.text = gesture.ToString();
        //		}
        //
        //		progressDisplayed = false;
        //	}

        return true;
    }
开发者ID:freddiehonohan,项目名称:HndCntrl,代码行数:16,代码来源:UserDetector.cs


示例20: GestureCancelled

    public bool GestureCancelled(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              KinectInterop.JointType joint)
    {
        if(progressDisplayed)
        {
            // clear the progress info
            if(GestureInfo != null)
            {
                GestureInfo.guiText.text = String.Empty;
            }

            progressDisplayed = false;
        }

        return true;
    }
开发者ID:freddiehonohan,项目名称:HndCntrl,代码行数:16,代码来源:SimpleGestureListener.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# KinectManager类代码示例发布时间:2022-05-24
下一篇:
C# KinectGestures类代码示例发布时间: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