Attempting to accomplish this task using a globe may present challenges. Here is the code snippet:
var geometry = new THREE.Sphere(200, 40, 30);
shader = Shaders['earth'];
uniforms = THREE.UniformsUtils.clone(shader.uniforms);
uniforms['texture'].texture = THREE.ImageUtils.loadTexture(imgDir+'world' +
'.jpg');
material = new THREE.MeshShaderMaterial({
uniforms: uniforms,
vertexShader: shader.vertexShader,
fragmentShader: shader.fragmentShader
});
mesh = new THREE.Mesh(geometry, material);
mesh.matrixAutoUpdate = false;
scene.addObject(mesh);
This setup involves applying a custom shader to the globe and utilizing a texture.
To simplify the process, creating a second sphere with a standard material might be more straightforward. Consider the following approach:
var geometry2 = new THREE.Sphere(200, 40, 30);
var material2 = new THREE.MeshLambertMaterial({ color: 'blue' });
var mesh2 = new THREE.Mesh(geometry2, material2);
scene.addObject(mesh2);