1
\$\begingroup\$

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.

Thanks in advance

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

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

\$\endgroup\$
1
  • \$\begingroup\$ I am gonna go with your anwser, but only because it more suits my project. But thank you both. \$\endgroup\$ Nov 25, 2012 at 18:32
1
\$\begingroup\$

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .