.x file question

Recommended Posts

derek7    100
I find some data at .x file .I want to know the different between two matrix :FrameTransformMatrix . Frame Bip01_Ponytail2 { FrameTransformMatrix { -0.784024,0.325567,-0.528501,0.000000,0.270116,0.945519,0.181745,0.000000,0.558878,-0.000264,-0.829250,0.000000,10.492052,2.728533,-5.129471,1.000000;; } Frame { FrameTransformMatrix { 10.667853,-0.000000,0.000000,0.000000,0.000000,6.709342,-0.000000,0.000000,-0.000000,0.000000,3.782927,0.000000,0.000000,-0.000000,-0.000004,1.000000;; } Mesh { ...................

Share on other sites
Jiia    592
The first is the state of the Bip01_Ponytail2 bone, where the second is the state of the mesh / object.

Share on other sites
Drew_Benton    1861
Guess I misunderstood that post [smile]

On the MSDN page for X File Templates it says that:
Quote:
 FrameTransformMatrix - Defines a local transform for a frame (and all its child objects).

So what you are looking at is just two 4x4 matrices:
-0.784024  0.325567 -0.528501 0.000000  0.270116  0.945519  0.181745 0.000000  0.558878 -0.000264 -0.829250 0.000000 10.492052  2.728533 -5.129471 1.000000

and

10.667853  0.000000  0.000000 0.000000  0.000000  6.709342  0.000000 0.000000  0.000000  0.000000  3.782927 0.000000  0.000000  0.000000 -0.000004 1.000000

Now I'm not sure how that translates (X,Y,Z,W perhaps?) but I'm sure you can see what they mean. If you want to find the difference between them, you will need to use Matrix operations if DX does not have anything built in.

Share on other sites
derek7    100
I want to know what does the mesh following the frame mean?

I find a point: many .x file have these pattern:

there is a frame at top of .x file and follow some skin weight data and then follow the frame too.

so what is different between these frame?

Frame v_body {
FrameTransformMatrix{...
Mesh {.....

SkinWeights {.....
SkinWeights {......

Frame b_d {....
FrameTransformMatrix{....
Mesh {.....

Share on other sites
Jiia    592
Quote:
 Original post by Drew_BentonGuess I misunderstood that post [smile]

Why? Everything you mentioned sounds correct to me. I meant matrix == state. It's just the transformation state that the object (frame) was in when it was exported.

derek: The x file is saved in a hierarchy. The code-style brackets are there to help visualize the relationships. Meshes are most likely under different frames because they belong to different parts of the skeleton. I can't be sure, I've never exported more than one mesh at a time. Each matrix in that file is the transform for that object, whatever it may be. Bones, meshes, footstep objects, etc.

In your example, it looks like two seperate mesh objects (v_body and b_d) were exported as different areas of the skeleton. They may have no relationship with each other (it doesn't look like it from the example). In which case, you just treat them as two seperate objects, and both need their own transform.

edit: Oh yeah, the most important thing is what I forget. Every new seperated object in an x-file is found beginning with a 'Frame' object. That's why each mesh has it's own frame. Frames are what signify the beginning of a new object.