After recently downloading three.js, I decided to create an earth in the universe. Everything was going well until I tried to add a texture to my Sphere. Suddenly, the Sphere disappeared and I can't figure out why. I've searched on various websites for a solution but haven't found anything that works :-/
Please, could someone help me out? I've run out of ideas and this issue is driving me crazy :D
I'm stuck on this part of the code:
var geometry = new THREE.SphereGeometry(0.5, 32, 32);
var material = new THREE.MeshPhongMaterial({
color: 0x4682B4,
map: THREE.ImageUtils.loadTexture('2_no_clouds_16k_002.jpg', {}),
bumpMap: THREE.ImageUtils.loadTexture('elev_bump_16k_002.jpg'),
specularMap: THREE.ImageUtils.loadTexture('water_16k_002.jpg'),
specular: new THREE.Color('grey')
});
var mesh = new THREE.MeshPhongMaterial({
color: new THREE.Color('red'),
wireframe: true
});
var sphere = new THREE.Mesh(geometry, material);
var earthMesh = new THREE.Mesh(geometry, mesh);
scene.add(sphere);
scene.add(earthMesh);
//--- Renderer --
function render
{
requestAnimationFrame(render);
sphere.rotation.y = + new Date() / 7000; //movement is added
renderer.render(scene, camera);
}
render();