   Max exporter help! How to convert a mirrored bone matrix to d3d matrix?
  I wrote a max exporter of my own format, all the translation must be convert to d3d format, left hand coordinate and y-up axis.The animation is work fine when there is no mirrored bone.But it render incorrect when a mirrored bone exist.how can I convert the mirrored bone matrix to d3d matrix?here is my convertion function:Matrix3 ConvertToDXMatrix(Matrix3& mat){    AffineParts localAff;    Matrix3  newMat;    decomp_affine(mat, &localAff);    Point3 position = Point3(localAff.t.x, localAff.t.z, localAff.t.y);    Point3 scale = Point3(localAff.k.x, localAff.k.z, localAff.k.y);    ApplyScaling(newMat, ScaleValue(localAff.k * localAff.f, localAff.u));    Quat   rotation(localAff.q.x, localAff.q.z, localAff.q.y, -localAff.q.w); Quat   sRotation(localAff.u.x, localAff.u.z, localAff.u.y, -localAff.u.w);    rotation.MakeMatrix(newMat);    newMat.SetRow(3, position);    newMat.Scale(scale);    Matrix3 srtm, rtm, ptm, stm, ftm;    ftm = ScaleMatrix(Point3(localAff.f, localAff.f, localAff.f));    ptm.IdentityMatrix();    ptm.SetTrans(position);rotation.MakeMatrix(rtm);    sRotation.MakeMatrix(srtm);    stm = ScaleMatrix(scale);    newMat = Inverse(srtm) * stm * srtm * rtm * ftm * ptm;    return newMat;}[Edited by - air_liang1212 on June 18, 2010 9:58:51 PM]
  What is the problem with the mirrored bone?I think a mirrored bone in Max is just another Max Node with a Transform matrix.I've made a Max exporter for Skeletal animation some months ago.I can give it to you if you want.   ;Quote:Original post by leonematiasWhat is the problem with the mirrored bone?Thank you, there is no problem with the mirrored bone itself. But if I convert the mirrored bone matrix to my dx matrix(left hand, y up matrix), the rendered object attached to this bone is incorrect. So I think may be something wrong with my convert function. You can email me with your export code. thanks a lot.;  The problem of the mirrored bones (and all things mirrored in Max) is, the matrix is not rotated but flipped. That means, the axis perpenticular to the mirroring plane is flipped. i.e., positive becomes negative, negative becomes positive.The simple solution is to just flip back the matrix before you convert it from Max to your convention. (not just flip it back as you need to consider the whole train of references on the parent child relation)There are a lot of such troublesome situations in Max because of the complex history of Max development over the time. Especially, there are many hidden attributes on how to interpret the math information which when exported directly, will give you incorrect results.You need to use experiment and experience to solve them all!   