Here is the code snippet I am working with: http://codepen.io/usf/pen/pGscf
This is the specific section of interest:
function animate() {
//sun.rotation.x = t/1000;
sun.rotation.y += 0.01;
t += 0.1;
earth.position.x = Math.sin((2*Math.PI/24*60*60)*timeScale*t)*300;
earth.position.z = Math.cos((2*Math.PI/24*60*60)*timeScale*t)*200;
camera.position.set(sun.position);
camera.lookAt(earth.position);
renderer.clear();
renderer.render(scene, camera);
window.requestAnimationFrame(animate, renderer.domElement);
};
I am trying to view Earth from the perspective of the Sun (lol), but for some reason, I am unable to see anything. What could be causing this issue? I feel like it might be a small mistake somewhere in the code that I just can't seem to pinpoint.