arena and cal3d problem?

Post Reply
laneway
Posts: 30
Joined: Thu Sep 15, 2011 2:08 am

arena and cal3d problem?

Post 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.
laneway
Posts: 30
Joined: Thu Sep 15, 2011 2:08 am

Re: arena and cal3d problem?

Post 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?
Post Reply