Question about code in chapter 3 of the second edition


#1

On page 33 of the second edition, I typed all the code for the avatar but nothing came up when I clicked on hide code.
Here is the code I typed after START CODING ON THE NEXT LINE:

var body = new THREE.SphereGeometry(100, 30, 20);
var cover = new THREE.MeshNormalMaterial();
var avatar = new THREE.Mesh(body, cover);
scene.add(avatar);

var hand = new THREE.SphereGeometry(50, 30, 20);

var rightHand = new THREE.Mesh(hand, cover);
rightHand.position.set(-150, 0, 0);
scene.add(rightHand);

var leftHand = new THREE.Mesh(hand, cover);
leftHand.position.set(150, 0, 0);
scene.add(leftHand);

var foot = new THREE.SphereGeometry(50, 30, 20);

var rightFoot = new THREE.Mesh(foot, cover);
rightFoot.Position.set(-75, -125, 0);
scene.add(rightFoot);

var leftFoot = new THREE.Mesh(foot, cover);
leftFoot.Position.set(75, -125, 0);
scene.add(leftFoot);


#2

Hi!

Have you checked the JavaScript console, as described in chapter 2? You’ve got this nearly perfect except for two tiny typos. The JavaScript console should point you right to the typos.

If you’re having trouble with the JavaScript console or still have a question after looking at it, let me know and I’ll give you a more specific hint.

-Chris


#3

That worked.
I did P instead of p.
:smiley:


#4

Awesome!!! :sunglasses::tada:

You’re always welcome to post questions here, of course. But programming is so much fun when you get to play code detective, right? :smiley:

-Chris