由用户创建的信息 enzotp
18 August 2017 15:40
18 August 2017 15:06
17 August 2017 22:22
Hi Folks !
Im trying to build a sort of mocap player with blend4web… My joint rotation code is something like this :
the result of this function applied to the set of the joints gives me something that resemble the original animation …. but its seems that a miss one step in the transformations … can you guys help me to figure what im doing wrong ?
Thanks
Enzo
Im trying to build a sort of mocap player with blend4web… My joint rotation code is something like this :
function rotateBone(rig,boneName,eulerX,eulerY,eulerZ)
{
var boneInfo= m_armat.get_bone_tsr_rel(rig, boneName);
var boneInfoInv= m_tsr.invert(m_armat.get_bone_tsr_rel(rig, boneName),m_tsr.create());
var boneQuat = m_tsr.get_quat_view(boneInfo);
var boneQuatInv = m_tsr.get_quat_view(boneInfoInv);
var rotQuatBone=m_util.euler_to_quat([eulerY,eulerX,eulerZ],m_quat.create());
var finalQuatBone=m_quat.multiply(boneQuatInv,boneQuat,m_quat.create());
m_quat.multiply(rotQuatBone ,finalQuatBone,finalQuatBone);
m_tsr.set_quat(finalQuatBone, boneInfo);
m_armat.set_bone_tsr_rel(rig, boneName,boneInfo);
}
the result of this function applied to the set of the joints gives me something that resemble the original animation …. but its seems that a miss one step in the transformations … can you guys help me to figure what im doing wrong ?
Thanks
Enzo
16 December 2015 20:56