Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i want to get rotation vector from matrix to realize some parent-children system for models.

 Matrix bonePos = link.Bone.Transform * World;
 Matrix m = Matrix.CreateTranslation(link.Offset)
       * Matrix.CreateScale(link.gameObj.Scale.X, link.gameObj.Scale.Y, 
       * Matrix.CreateFromYawPitchRoll(MathHelper.ToRadians(link.gameObj.Rotation.Y),
//need rotation vector from bone matrix here (now it's global model rotation vector)
        * Matrix.CreateFromYawPitchRoll(MathHelper.ToRadians(Rotation.Y),
         * Matrix.CreateTranslation(bonePos.Translation);
link.gameObj.World = m;

where : link - struct with children model settings, like position, rotation etc.
And link.Bone - Parent Bone

share|improve this question
there is a Matrix.Decompose method, if thats what you are looking for – Kikaimaru Oct 15 '12 at 9:26
yeah, thanks a a lot :) – mr.Smyle Oct 15 '12 at 9:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.