none
Motion tracking RRS feed

  • Question

  • Hello!

    I recently started to work on the KinectExplorer WPF sample, and I can't seem to get something to work for me.

    I'm simply trying to have a textBox in the "KinectWindow" that shows in real time the X,Y,Z coordinates of the left hand wrist.

    I did it in the SkeletonBasics sample like so (this was added within the DrawBonesAndJoints function):

    Wrist = skeleton.Joints[JointType.WristLeft];
    
                this.textBox2.Text = "x=" + (Wrist.Position.X * 100).ToString() +
                                "   y=" + (Wrist.Position.Y * 100).ToString() +
                                "   z=" + (Wrist.Position.Z * 100).ToString();

    Of course I added this line as well:

    public Joint Wrist;

    In the SkeletonBasics sample, it worked flawlessly. However, I get a bunch of errors when it comes to the KinectExplorer sample. I tried to tweak some stuff and then it just hid or turned off the DepthTreatment and disabled the skeleton for some reason.

    So back to my question: How do I manage to have a textBox displaying the currect X,Y,Z coordinates of the left hand wrist in the "KineckWindow" window?

    Thank you so much in advance, this is truly important to me!

    Tuesday, September 16, 2014 4:58 PM

All replies

  • Kinect Expolorer main application is separate from the WpfViewers that actually handle the visualizers for the skeleton tracking. You can create the textbox in the KinectSkeletonViewer.xaml/.cs file and that should work. Otherwise, you probably will need to create a bindable property on the control so that any time you update your Wrist value, the update on the main UI will take effect. 

    Carmine Sirignano - MSFT

    Tuesday, September 16, 2014 8:51 PM
  • Kinect Expolorer main application is separate from the WpfViewers that actually handle the visualizers for the skeleton tracking. You can create the textbox in the KinectSkeletonViewer.xaml/.cs file and that should work. Otherwise, you probably will need to create a bindable property on the control so that any time you update your Wrist value, the update on the main UI will take effect. 

    Carmine Sirignano - MSFT



    Let me explain: There is an SDK sample called KinectExplorer. If you run it in Visual Studio, 2 windows will open up: 1 is a window telling you whether a Kinect device is plugged in or not, and the 2nd window is a window named "KinectWindow" that has the depth video, audio controls, regular video, skeleton and other options in it. Now, what I want is to have real-time x,y,z coordinates of the left hand wrist in a textBox in either a completely new window or in that "KinectWindow". New window wouldeven work better for me.
           
        
    I need to continue in a new comment. All the skeleton drawing functions are in a file called KinectSkeleton.cs which has not associated window to it. I would like to have another window open up, place textBoxes in it and control the information appearing in those textBoxes through that KinectSkeleton file preferably. Thank you again :)

    Notification


    • Edited by DanielAtt Thursday, September 18, 2014 12:41 PM
    Thursday, September 18, 2014 12:15 PM
  • You will need to review how to pass events and values to other windows in WPF which is not a Kinect specific question. As stated, the KinectSkeleton is a user control, which has its own control Xaml layout(KinectSkeletonViewer.xaml). If you are not sure how this works, you need to ask over on a WPF specific forum for help with that.

    Kinect will only provide you with the data, how you visualize or need to use that would be up to you. If the control is rendering correctly as show in the sample, then the Kinect part of the sample is working correctly.


    Carmine Sirignano - MSFT

    Thursday, September 18, 2014 6:53 PM