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 of code.
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. With leftHand.position.set(150, 0, 0), we set the X position to 150. We want to change the second number too. 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 added before rendering the scene as well.
Here is how we did the right ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access