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 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 in my example. However I cannot figure out how to also add in a rotation around the elbow for the forearm.

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

2 Answers 2

up vote 2 down vote accepted

The transformation that you are describing is relatively simple and as you can see is very difficult to know what steps must be follow to achieve it.

When you solve this, you'll find with more problems with the next transformation. Then I encourage you to use "Hierarchical Transformations", at end of this article is described.

With "Hierarchical Transformations" you save a simple transformation ( a matrix for example ) in each node of the hierarchy. A node can be the arm, other the elbow, forearm, legs, etc. The final transformation is acomplished with the combination of all the simples transformations. Once the system is built, whatever transformation is easy to achieve.

share|improve this answer

Have you tried doing the forearm transformation first? I think you may just have the transforms in the reverse order.

share|improve this answer
    
I just tried it. I was hopeful but it looks the same as before. –  Xavier Mar 31 '11 at 2:53
    
One thing I'm doing that I'm beginning to suspect I shouldn't is that each time I animate I perform the transforms from the last position instead of the mesh at the origin. Do you think perhaps I should always do the transform of the mesh from the origin? –  Xavier Mar 31 '11 at 3:53

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.