Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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

share|improve this answer
    
Will try it out, thanks. –  user1806687 Nov 25 '12 at 18:02
    
I am gonna go with your anwser, but only because it more suits my project. But thank you both. –  user1806687 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.

share|improve this answer
    
Thanks! And sorry I cant upvote your anwser, I dont have enough reputation yet :/ –  user1806687 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? –  user1806687 Nov 25 '12 at 18:03
    
Also what is the correct way of multiplying existing matrix with rotation, and position. –  user1806687 Nov 25 '12 at 18:11

Your Answer

 
discard

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.