none
How can i create my own SkeletonData? RRS feed

  • Question

  • Hello, i am working for save and reproduce Skeletons. For save than i dont have problems to save all the poins (X Y Z) in a TXT file. Then, i recovery all the points but when y want to draw them i must create all Joints. My question is: " How can i create Joints from X Y Z data?" 

    Thanks

    Thursday, September 22, 2011 2:24 PM

Answers

  • Dario,

    Sorry for giving you bad advice. JointsCollection class has an internal constructor, which means that the code I wrote worked from context of the same assembly, but I should have tested it from a different managed application.

    Since there is no public constructor then there is no way for you to create a JointsCollection object in the Kinect SDK Beta 1. Sorry. You'll have to create your own equivalent structure to deal with this problem.

    Eddy


    I'm here to help
    Monday, October 3, 2011 7:38 PM

All replies

  • It's a bit unclear what you're doing (and why you'd export it as text, instead of handling the data more efficiently).  However, I think your broad question is how to create a Joint object?

    Thursday, September 22, 2011 3:20 PM
  • thanks mattharvest!

    well, i must export the position of all the points of one Skeletons to a TXT file becouse in other aplication we use them in that format. However, you are right! my question is how to create a Joint object? and add to a new JointCollection. 

    Thanks

    Thursday, September 22, 2011 5:56 PM
  • Well, Joint is a struct value type, so you should be able to do something like:

    Microsoft.Research.Kinect.Nui.Vector pos;
    pos.X = 1.0f;
    pos.Y = -1.0f;
    pos.Z = 0.5f;
    pos.W = 1.0f;
    
    Joint joint;
    joint.Position = pos;
    joint.ID = JointID.HandLeft;
    joint.TrackingState = JointTrackingState.Tracked;

    JointsCollection jointsCollection = new JointsCollection();
    jointsCollection[JointID.HandLeft] = joint;


    and so on for each of the joints.

    Does that make sense?
    Eddy


    I'm here to help
    Saturday, September 24, 2011 12:45 AM
  • Thank you Eddy!

     

    It make sense but i have one problem with this line 

     

    "JointsCollection jointsCollection = new JointsCollection();"

     

    becouse JointCollection dont have constructor. There are another way to create a JointsCollection?

     

    Thanks so much!



    Monday, October 3, 2011 12:29 PM
  • Dario,

    Sorry for giving you bad advice. JointsCollection class has an internal constructor, which means that the code I wrote worked from context of the same assembly, but I should have tested it from a different managed application.

    Since there is no public constructor then there is no way for you to create a JointsCollection object in the Kinect SDK Beta 1. Sorry. You'll have to create your own equivalent structure to deal with this problem.

    Eddy


    I'm here to help
    Monday, October 3, 2011 7:38 PM
  • thank you so much Eddy!
    i am going to implement my own structs to create something similiar to a JointCollection. Any way, your help was useful.
    bye! 
    Tuesday, October 4, 2011 12:52 AM