# XNA- Scale only parent

I was wondering, is it possible to Scale(Vector3) a ModelBone without scaling its children. Lets say I got a Bone A at position 1,0,3. And one of its children Bone B is at position 1,0,5 (he is touching Bone A). Could I scale Bone A along Z axis without scaling Bone B, but keep Bone B position and rotation so that he is still touching Bone A.

If you scale the parent bone by factor A, scale the child by 1/A and it will keep the size.

Ej. if parent scale is multiplied by 2 you should mulptiply child scale by 1/2 = 0.5f

• I am gonna go with your anwser, but only because it more suits my project. But thank you both. Nov 25 '12 at 18:32

When you call CopyAbsoluteBoneTransformsTo(), it goes through the model's bone collection and applies parent SRTs to the children SRTs and places the results in a Matrix[]. So if after calling that, you then go into the resulting Matrix[], you could pick out BoneA's transform, apply some Z scale to it and it will not affect its children.

Notice you go into the resulting Matrix[] to do this, not the underlying model Bone collection. If you did this to BoneA's matrix in the underlying model bone collection, it would then apply that z scale to the children on the next frame when you again call CopyAbsoluteBoneTransformsTo() and it doesn't sound like you want that.

• Thanks! And sorry I cant upvote your anwser, I dont have enough reputation yet :/ Nov 25 '12 at 17:54
• btw, If I already have some <code>Matrix transform</code> should I apply scale like: <code> scale * transform </code> or any other way? Nov 25 '12 at 18:03
• Also what is the correct way of multiplying existing matrix with rotation, and position. Nov 25 '12 at 18:11