Page 1 of 1

arena and cal3d problem?

Posted: Sat Oct 22, 2011 6:46 am
by laneway
I was wondering whether anyone has any experience using cal3d to get real time data from arena by natnetsdk to drive a virtual character in my app.

These days i try to do this but the actions of virtual character in my app are different from arena.

in arena, check "Local child data" and "rigidbody data".

i use "setTranslation()" to translate the position of root bone. and use "setRotation()" to rotate the orientation of all bones. "setTranslation" and "setRotation" is cal3d API function.

Re: arena and cal3d problem?

Posted: Sun Oct 23, 2011 10:22 pm
by laneway
I am really new to Cal3d.
my client app code like this:
......
map mapBoneID;
int person1 = 0;// the first person
float x,y,z,qx,qy,qz,qw;
ArenaObject* pObject = getArenaObj();
pObject->getBoneTranslation(0,x,y,z);
......
CalBone* pRootBone = pSkeleton->getBone(0);
pRootBone->setTranslation(CalVector(x,y,z));

CalBone* pBone;
int nBone = pObject->getBoneCount(person1);
for(int i =0;igetBone(i);
if(pBone)
{
int nID = mapBoneID;//arena bone id
pObject->getBoneRotation(nID,qx,qy,qz,qw);
CalQuaternion quatInit = pBone->getCoreBone()->getRotation();
pBone->setRotation(CalQuaternion(qx,qy,qz,qw)*quatInit);
}
}
anyone can give me some advise? why does my client app integrate cal3d to use arena data to drive a avatar to get motions different from arena?