none
Box over skeleton joints are not rotating properly RRS feed

  • Question

  • Hi,

    I am trying to create a box man in OpenGL using Kinect for Windows V2 using C++. I have drawn boxes using using adjacent skeleton joints.Then I took  joints Quaternion value ,then converted to Euler angles. Then I am apply Euler angles to rotation matrix. But it is not working correctly. the Problem is each and every boxes are placed in different places. How to rectify this problem ? And Am I doing correctly?please give your suggestions...

    void CubeCreation(const Joint& rJ1, const Joint& rJ2, Vector3 EulerAngles) 
    { 
    glPushMatrix(); 
    glTranslatef(rJ1.Position.X,rJ1.Position.Y,rJ1.Position.Z);
    glRotatef(EulerAngles.v[0],0,0); 
    glRotatef(EulerAngles.v[1],0,1,0);
    glRotatef(EulerAngles.v[2], 0,0,1);
    glEnable(GL_DEPTH_TEST);
    glBegin(GL_QUADS); 
    
    //Here Creating box Logic Using two Joint Values
    
     glEnd();
    
     }

    Thanks.

    Friday, May 8, 2015 2:35 PM

Answers

  • we provide code for the box man demo in the Kinect Evolution sample in the SDK broswer. Are you applying the rotation at the origin before moving the joint into place or at the position in the world. Keep in mind, the joints are all in relation to the Kinect camera/coordinate space. The Y component of the joint orientation is the direction of the joint from its parent.

    Carmine Sirignano - MSFT

    Friday, May 8, 2015 6:26 PM