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.

  • You’ll have to move them down. The up/down positioning is done with the Y direction instead of the X direction. This is the second number of right_hand.position.set(-150, 0, 0). You may have to use negative numbers to go down—for example, –25.

  • Recall that the hand was added before we rendered the scene—before the line with renderer.render(scene, camera). The feet should be as well.

Here is how we did the right hand; it might help while you try to figure out the feet:

 
var​ hand = ​new​ THREE.SphereGeometry(50); ...

Get 3D Game Programming for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.