Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm working on rotating human limbs in a 3d game. I use Linear Algebra matrix rotations and translations to achieve moving the human and limbs. I currently can rotate around a pivot point by first translating to the pivot point then performing the rotation and finally translating back to the origin. I do that easily enough for the shoulder. However I cannot figure out how to also add in a rotation around the elbow for the forearm. The whole issue of the upper arm rotating thus moving the elbow point which I must then rotate around is throwing me off.

I've tried the following for the forearm rotation around the elbow:

1)translate to shoulder, rotate, translate to origin, translate to forearm, rotate, translate to origin 2)translate to shoulder, rotate, translate to forearm, rotate, translate to shoulder, translate to origin

Neither work for me. Any suggestions? I'm really stuck on this one.

share|improve this question
    
Any moving point is fixed when considering infinitesimal rotations about the point. I suggest looking at it from this perspective and integrating. –  Alex Becker Mar 31 '11 at 3:19

1 Answer 1

up vote 0 down vote accepted

I'll restate your problem to make sure I understand it correctly: You have a shoulder joint, an upper arm segment, an elbow joint and a forearm segment. If you turn the shoulder joint, everything else moves; if you turn the elbow joint, only the forearm segment moves. You want to rotate both joints at the same time and find out how the forearm segment moves. I presume that in your description of the approaches you've tried, by "translate to forearm" you mean "translate to elbow".

The problem with the two approaches you tried seems to be that in each case there's a translation to the elbow joint after the elbow joint has already been rotated by a rotation around the shoulder joint. You need to do the rotation around the elbow joint first, since the shoulder joint moves the elbow joint but not vice versa. Thus:

3) translate to elbow, rotate, translate to origin, translate to shoulder, rotate, translate to origin

share|improve this answer
    
Yes you understood correctly what I was asking, thank you for clarifying. Your response makes sense however it didn't work for me (I'm not saying its wrong). I'm beginning to suspect something else as my problem. When I perform the transforms on the human it is from the last position (the previous set of transforms result) and not from the starting position. I'm beginning to wonder if that is causing problems. –  Xavier Mar 31 '11 at 4:01
    
At least that will complicate things. Whether it works will depend on whether you properly keep track of how everything you've done in the past has added up. For debugging, I'd suggest to try only a rotation around the elbow. If that works as intended, you know the problem is in how you combine the two rotations. If it doesn't and the elbow moves instead of just rotating, that means you haven't properly kept track of where the elbow is and are trying to rotate around a different point (perhaps the initial position of the elbow?). –  joriki Mar 31 '11 at 4:09

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.