Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
dotXSI and bones/skinning code

dotXSI and bones/skinning code

2005-06-06       - By Daniel

 Back
Hi,

I have moved all my engine work over from using custom plugin for xsi into
using the dotXSI format and the FTK.
Its all working great for all geometry, etc but i have problems with getting
the bones to work correct.

My basic code looks kinda of like this:
What this code is supposed to do is to calculated the global inverse matrix of
the the rest position of the bone.

buildSkinInfo(CSLModel* model)
{
// cut away some init, setup, etc, code

  CSLEnvelope** envelopList = model->GetEnvelopeList();

  for (int i = 0; i < model->GetEnvelopeCount(); ++i)
  {
      CSLEnvelope* envelope = envelopList[i];

      CSLModel* deformerModel = envelope->GetDeformer();
      Node* boneNode = findNode(deformerModel);  // node is a own type of node
, basic just a simple Node in a scenegraph
           m_bones[i].setTarget(boneNode);  // stores the target for the node

      CSLTransform* transform = deformerModel->GetBasePose();
      transform->ComputeGlobalMatrix();
      CSIBCMatrix4x4& globalMatrix = transform->GetGlobalMatrix();
      CSIBCMatrix4x4 inversMatrix;

      globalMatrix.GetInverse(inversMatrix);
      m_bones[i].setRestTransform(inversMatrix);

      //...
}

And later in my update function

void update(float time)
{
  // this code assumes that all targets have been updated with animations,
positions, etc already

  for (uint i = 0; i < bones.count(); ++i)
     m_bones[i].setTransform(m_bones[i].restTransform() * m_bones[i].target()-
>worldTransform()); // matrix multiply the 4x4 matrises

  // and then use the matrices calculated here with the weights etc stored in
the envelopes.
}

I wonder if anyone on this list has done anything similar to this and got it
working, any help would be very appreciated.

Daniel


---
Unsubscribe? Mail Majordomo@(protected) with the following text in body:
unsubscribe xsi