# Computed rotation matrix to quaternion?

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

## Recommended Posts

Hello! I've got a problem, and don't even know whenever this is possible to solve in that way. The best way to explain is to demonstrate what I do:
LocalBoneMatrix = Matrix.Identity;
LocalBoneMatrix = Matrix.CreateRotationX(x) * Matrix.CreateRotationY(y) * Matrix.CreateRotationX(z);
LocalBoneMatrix.Translation = new Vector3(x,y,z); //sets M._41, _42, _43

Okay, so far it is clear and simple. But the problem appears whenever I try to create a quaternion and translation like this:
Quaternion rotation = Quaternion.FromMatrix(LocalBOneMatrix);
Vector3 position = LocalBoneMatrix.Translation;
Matrix comp = new Matrix.FromQuaterion(rotation);
comp.Translation = position;

The wierd stuff is that the comp matrix is not the same as LocalBoneMatrix and the animaton gets messed up. Is it possible to store 3 different rotation into one quaternion and restore it?!

##### Share on other sites
Looks to me like you are setting the matrix to a translation after you apply rotation, instead of multiplying rotation by translation and then setting.

But I use Dx10 and I have no idea what you are using with matrix properties. I guess its XNA. So, I can't follow what's going on.

1. 1
2. 2
Rutin
25
3. 3
4. 4
5. 5

• 10
• 10
• 13
• 20
• 14
• ### Forum Statistics

• Total Topics
632950
• Total Posts
3009374
• ### Who's Online (See full list)

There are no registered users currently online

×