Hello Chris,
I was working in Chapter 1 and 3 and I noticed something: every time I try to do anything with motion or animating, everything where the shapes are supposed to be just goes white. I don’t know what to do!
Here’s my code for the cartwheels in Chap. 3:
// ******** START CODING ON THE NEXT LINE ********
var body = new THREE.SphereGeometry(100);
var cover = new THREE.MeshNormalMaterial(flat);
var avatar = new THREE.Mesh(body, cover);
scene.add(avatar);
var hand = new THREE.SphereGeometry(50);
var leftHand = new THREE.Mesh(hand, cover);
leftHand.position.set(-150, 0, 0);
avatar.add(leftHand);
var rightHand = new THREE.Mesh(hand, cover);
rightHand.position.set(150, 0, 0);
avatar.add(rightHand);
var foot = new THREE.SphereGeometry(50);
var leftFoot = new THREE.Mesh(foot, cover);
leftFoot.position.set(-75, -125, 0);
avatar.add(leftFoot);
var rightFoot = new THREE.Mesh(foot, cover);
rightFoot.position.set(75, -125, 0);
avatar.add(rightFoot);
// Now, show what the camera sees on the screen:
function animate() {
requestAnimationFrame(animate);
avatar.rotation.z = avatar.rotation.z + 0.05;
renderer.render(scene, camera);
}
animate();
Thanks,
Jakin