3D Game Programming

(C. Jardin) #1
But why 150? The answer is that the radius of the body is 100 and the radius
of the hand is 50. We need to move the hand 100 + 50, or 150 in the X
(left/right) direction:

If we only moved the center of the hand 100, then we would end up with the
hand partly inside the body:

Try This Yourself
If you’re not convinced, try it yourself. Change the number for the
X position by fiddling with the first number in right_hand.position.set(-
150, 0, 0). Try it for both the left and right hand. Don’t make them
too big, though, or they won’t even be on the screen anymore!

3.4 Adding Feet for Walking


For the feet, we’ll again use spheres of size 50. I’ll leave it up to you to figure
out how to add the relevant lines.

Some hints:



  • Don’t move the feet left/right as far as we did the hands. The feet should
    be underneath the body.


report erratum • discuss

Adding Feet for Walking • 29


Prepared exclusively for Michael Powell

Free download pdf