Jump to content

reading a skeleton bone from kinect


photo

Recommended Posts

Can we please have a small code snippet of reading a particular bone position from kinect....? (lets say left hand....)

i am bit confused with the body index......:(

 

Thanks......

Link to comment

also would there be a particular way to attach lets say a particle system to the one bone.....?

 

thanks....:D

Link to comment

Hi Marinos,

 

Please, don't worry, we saw all your questions. Right now, I'm afraid, all the developers are quite busy - that's why there is no answer yet. I will try to raise the priority of this topic.

 

Btw, have you checked the kinect_01 sample? Which exactly part of this code is causing difficulties on your side, could you please explain?

 

Sorry for the inconvenience caused.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Haha thank you Silent, I do understand that certain posts have priority over others, so don t worry I am not stressing.... Never the less my issue is that trying to read a particular bone (lets say a wrist on the left hand) i am getting 0's as returns and not the actual positions even though the actual skeleton is updated overall. So the sample does work but i think that I am doing something wrong with the body index from the engine.kinect.getBonePosition(int body, int bone) function..... So i thought like a short snippet of reading a particular bone position, or a short example of attaching something like a soft body or particle system on a particular bone, would be useful.....

 

All the best....

m

Link to comment

Hi Marinos,

Unigine Kinect plugin is designed in such way that when engine.kinect.isBodyTracked(body) returns 0, engine.kinect.getBonePosition(body, bone) will return vec3_zero.
Kinect has its own framerate and body tracking information is not available each engine frame.
That's why Skeleton class in kinect_01.cpp sample remembers bone positions in array and uses them for a while, until body tracking information is updated.

Sample for wrist tracking will look like this:

vec3 wrist;

int update() {
    if(engine.kinect.isBodyTracked(0)) {
        wrist = engine.kinect.getBonePosition(0,KINECT_BONE_WRIST_LEFT);
    }
    engine.visualizer.renderSphere(0.05f,translate(wrist),vec4_one);
    return 1;
}
  • Like 1
Link to comment
  • 3 weeks later...

nope it can t be so simple like that, unless there is a bug the suggested code is not working... not updating and the sphere is not translated to the vec3 wrist position.... it just stays in the center.... is weird cause all this is based on kinect_01 sample where bone positions are being used for the skeletons and seem to work.... trying to access a single bone in the update function is NOT working though... my initial approach was same as the suggested code... i just gave it one more try ( and many more) but for some reason is not working at all..... 

Link to comment

would i have a better chance creating a class similar to the skeleton class in the sample for reading a wrist for example (a class that has it's own update function).....??? not sure please look into it a bit....

Link to comment
×
×
  • Create New...