I have a question about the matrix...
Code:
osg::Matrix
KinectOSGMainLogic::getBoneMatrixFromKinectNuiControl(NUI_CONTROL_SKELETON_POSITION_INDEX
id)
{
float rotArray[3] =
{nuiControl->skeletonOrientations[nuiControl->activeSkeletonIDs[0]][id]->_array[0],
nuiControl->skeletonOrientations[nuiControl->activeSkeletonIDs[0]][id]->_array[1],
nuiControl->skeletonOrientations[nuiControl->activeSkeletonIDs[0]][id]->_array[2]};
//rotArray is the rest of Shoulder-Elbow position
osg::Vec3 orientVec(rotArray[1],-rotArray[0],rotArray[2]);
float dp = 0.0;
osg::Vec3 vecRight(osg::Vec3(1.0,0.0,0.0));
for (int i=0;i<3;i++)
dp += orientVec[i] * vecRight[i];
float angle = acos(dp);
orientVec.operator ^(vecRight);
orientVec.normalize();
osg::Matrix mat(osg::Matrix::rotate(osg::Quat(angle,orientVec)));
return mat;
}
The matrix I take out of here, would be local or global? if it is global, what
I would have to do to pass to local?
Thank you!
Cheers,
Aitor
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41257#41257
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org