Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Problem exporting bones in 3d Studio Max 6

This topic is 5615 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I´m trying to write my own plugin for 3d Studio Max 6 to export geometry and bones using the IGameExporter that comes with de Max SDK. The geometry is OK, but I have a problem with the transformation of the bones. I´m using this recursive function: void IGameExporter::BoneRecursive(Matrix3 &mat, IGameNode *Parent) { if (Parent){ BoneRecursive(mat, Parent->GetNodeParent()); mat = mat * Inverse(Parent->GetLocalTM().ExtractMatrix3()); } } and I´m calling it this way: static Matrix3 rootTM(true); if (hm->InitializeData()) { Matrix3 parentTM, nodeTM, localTM(true); IGameNode * Parent = child->GetNodeParent(); nodeTM = child->GetLocalTM().ExtractMatrix3(); nodeTM.NoScale(); if (Parent) { parentTM = Parent->GetLocalTM().ExtractMatrix3(); parentTM.NoScale(); localTM = parentTM * nodeTM; m_Bones[uiBoneCount].m_uiParent = Parent->GetNodeID(); BoneRecursive(localTM, Parent); } else { localTM = child->GetLocalTM().ExtractMatrix3(); localTM.NoScale(); rootTM = localTM; } m_oxbAuxBones[uiBoneCount].m_uiID = child->GetNodeID(); Point3 row = localTM.GetRow(1); localTM.SetRow(1, localTM.GetRow(2)); localTM.SetRow(2, row); Point4 column = localTM.GetColumn(1); localTM.SetColumn(1, localTM.GetColumn(2)); localTM.SetColumn(2, column); localTM.SetRow(0, -(localTM.GetRow(0))); localTM.SetColumn(0, -(localTM.GetColumn(0))); Quat quat(localTM); Point3 euler; QuatToEuler(quat, &euler.x); EulerToQuat(euler, quat); m_Bones[uiBoneCount].m_oxqRotation.w = quat.w; m_Bones[uiBoneCount].m_oxqRotation.x = quat.x; m_Bones[uiBoneCount].m_oxqRotation.y = quat.y; m_Bones[uiBoneCount].m_oxqRotation.z = quat.z; } The first level of the tree is OK, but the rotations of the other levels of the bone tree are wrong. I´ld like if anyone of you could help me with this, because I´ve spend lots of hours trying to solve it. Thanx,

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!