# Matrix Challenge

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

## Recommended Posts

Hey, math guys, how's it going? I bet none of you are awake at 5:30 am, are ya? I don't want to pull a double-forum post, but I have little choice. I'm hoping that someone in here semi-understands skeletal animation, because I don't think many lurkers in the DirectX forum semi-understand matrix math; myself included. Please see the last reply on this thread. I'm sure it will stay the last reply for a while. If not, I'm referring to the later reply by me showing this:
  0.000000,  1.000000,  0.000000,  0.000000,
-1.000000,  0.000000, -0.000000,  0.000000,
-0.000000,  0.000000,  1.000000,  0.000000,
27.423233, 34.577133,  0.000000,  1.000000

// Keep in mind that an identity matrix looks like..

1.000000,  0.000000,  0.000000,  0.000000
0.000000,  1.000000,  0.000000,  0.000000
0.000000,  0.000000,  1.000000,  0.000000
0.000000,  0.000000,  0.000000,  1.000000


If the toe's identity matrix comes out like the top matrix, does anyone know how I can fix it? The problem is that it's not as simple as inverting it and multiplying the result with all of the bone states. Every single bone is different. Or rather, messed up in it's own way. I'm sure there is logical reasoning behind all of this, but what is it? Does anyone know? If I had an animation of a character that didn't move at all, and stayed in it's default pose, I could invert those frame matrices, and multiply each result with each bone keyframe in a real animation, and it would fix the frames in the real animation. See what I'm saying? The data I need is in there, but I don't understand what else is. Anyone understand any of this? Thanks for any help.

##### Share on other sites
well, right, i'm awake before 2am because i'm in different timezone.

That matrix is matrix that turns X to Y .
And also (it's written as vector is a row,right?) , it translates by (27.423233, 34.577133 ,0)

I don't know how you get that matrix,i don't use directX, i don't use .x files and have thought .x files it's some configuration files for X-Server [grin].(edit: and i don't know how you want to use that matrix,or "fixed" matrix [grin].)

If you're getting that matrix from some editing program,(and you really-really-really sure it must be identity) that's problems with that editing program, ask developer, __look_as_specification_of_your_format__(!!!) ,etc.

Or you have a load of bugs somewhere else. (99% sure it's so)
edit: that is, maybe you use that matrices in wrong way(incorrect multiplication order,etc), and are truing to fix it by doing things to be double-wrong.

find somewhere code that draws data from ".x" file and look at it.

the problem is, your question is not mathy question because it assumes math guys must know directX and .x format

"If the toe's identity matrix comes out like the top matrix, does anyone know how I can fix it? "
Ream math guy 's reply:
no problem,let's M it's your matrix. In C++,type M=identity; , it's _fixed_ now. [grin]

[Edited by - Dmytry on September 14, 2004 5:01:34 AM]

##### Share on other sites
Quote:
 Original post by Dmytrywell, right, i'm awake before 2am because i'm in different timezone.

I haven't been to sleep yet. hehheh. I've been running in circles, kicking things, cursing Microsoft, and pretty much going nuts, like a dumb animal that needs put down. I'm losing it.

Quote:
 Original post by DmytryThat matrix is matrix that turns X to Y .And also (it's written as vector is a row,right?) , it translates by (27.423233, 34.577133 ,0)

I noticed that. But I don't understand why in the world it would be that way. Yes, that matrix is written as a vector for each row. Or at least I hope so. How could I know, really, since it doesn't make any sense to me?

Quote:
 Original post by DmytryI don't know how you get that matrix,i don't use directX, i don't use .x files and have thought .x files it's some configuration files for X-Server [grin].(edit: and i don't know how you want to use that matrix,or "fixed" matrix [grin].)

That matrix is from a bone in an animation. The bone doesn't move in the actual animation. So I assumed it should be identity. But it's not. Go figure [grin]

Quote:
 Original post by DmytryOr you have a load of bugs somewhere else. (99% sure it's so)edit: that is, maybe you use that matrices in wrong way(incorrect multiplication order,etc), and are truing to fix it by doing things to be double-wrong.

It can't be a bug. That matrix is pulled directly out of the ascii version of the X file. It's the first keyframe of animation for the left toe, which doesn't move in the real animation. Copy & Pasted from notepad.

Quote:
 Original post by Dmytryedit:somewhat helpful idea:find somewhere code that draws data from ".x" file and look at it.

Everyone seems to use Microsoft's tools, like the AnimationController. So no one has code except Microsoft.

Quote:
 Original post by Dmytrythe problem is, your question is not mathy question because it assumes math guys must know directX and .x format

I know. I'm sorry for that. I'm very desperate. [disturbed]

##### Share on other sites
What if it's the orientation and position of the bone in world space.

Or, it converts from right handed coordinate system into left handed.

##### Share on other sites
but, i don't see why if it's not moving in animation it must be identity.

There must be specification of .x files somewhere in the net - programs that write into .x files surely don't use microsoft reader/writer, for portability reasons.

##### Share on other sites
Quote:
 Original post by FtnWhat if it's the orientation and position of the bone in world space.Or, it converts from right handed coordinate system into left handed.

Ahhh. These are the types of answers I've been waiting for.

If each bone's keyframe matrix includes it's absolute world orientation, then it won't look very nice being passed through the hierarchy. In any case, how would it be possible to extract the orientation part from each keyframe?

If it was converting from right to left handed systems, wouldn't all bones be messed up the same way? Only certain bones are really bad, others are almost normal. The toes, thighs, and shoulders are really messed up. Some other bones look slightly off, but they are not nearly as lossed.

I appreciate the help.

##### Share on other sites
Quote:
 Original post by DmytryThere must be specification of .x files somewhere in the net - programs that write into .x files surely don't use microsoft reader/writer, for portability reasons.

Well, my models are being created and animated in 3D Studio. But then I use an X-File exporter to convert to the format. There is no documentation on the transformation matrices because everything in an X file is a template, and is unique to that specific file. In other words, the format can include different types of things, so it's very abstract.

However, the model I'm using now is from samples included with the DirectX SDK. A model called Tiny.x. So nothing of mine is touching these matrices. This is the way they were shipped.

##### Share on other sites
well,what i'd try:
1: as i understand your file is a tree-like structure, each node have matrix. Ordinally travel tree while rendering it, starting from the root. When entering subnode store current matrix in stack and multiply current matrix with node's matrix at the left(for directX). That is, if current matrix is M and node's matrix is N , M=N*M (if i understand right that directX uses row-vectors, that is,vector is transfromed by Vector*Matrix, not Matrix*Vector)
When leaving node,restore the matrix using the stack.

Note that we can do animation by changing these matrices. Each matrix "corresponds" to bone. That's how i'd do it. Don't know about microsoft.

Second possibility:
Don't keep matrix stack, use each node's matrix as is to transform node's vertices.

And, there's no real reason why matrix must be identity if it's not moving during the animation . I think you're truing to solve things in wrong way.

• 18
• 29
• 11
• 21
• 16