I have my animated earth and moon working now. Thank you to all of you who answered my previous questions. Now on to aesthetics. My earth, as you can see in the screen is too dark and too blue. What can I do to make it look more like the picture of earth you can see in the lower right hand corner of the screenshot? Not the clouds, just the light blue and ambient light. What is an easy way to make my earth look brighter and a lighter blue?
Note, please do not discount obvious solutions. Chances are I did not think of them. I am an experienced programmer but a graphics weakling. The easier and faster a fix I can apply, the better.
Here is my code:
// The group we use to contain the solar system.
g_TheSolarSystem_group = new THREE.Group();
// -------------------- BEGIN: BUILD THE EARTH AND MOON ------------
const textureLoader = new THREE.TextureLoader();
const earthGeometry = new THREE.SphereBufferGeometry( EARTH_RADIUS, useSegments, useSegments );
const earthMaterial = new THREE.MeshPhongMaterial( {
// specular: 0x333333,
// shininess: 5,
specular: 0x2222FF,
shininess: 35,
map: textureLoader.load( '/javascripts/threejs/examples/textures/planets/earth_atmos_2048.jpg' ),
specularMap: textureLoader.load( '/javascripts/threejs/examples/textures/planets/earth_specular_2048.jpg' ),
normalMap: textureLoader.load( '/javascripts/threejs/examples/textures/planets/earth_normal_2048.jpg' ),
normalScale: new THREE.Vector2( useScale, useScale )
} );
g_TheEarth = new THREE.Mesh( earthGeometry, earthMaterial );
// Set the earth position.
g_TheEarth.position.set( EARTH_X_POS, EARTH_Y_POS, EARTH_Z_POS);
// Add the Earth to the group.
g_TheSolarSystem_group.add(g_TheEarth);
const moonGeometry = new THREE.SphereBufferGeometry( MOON_RADIUS, useSegments, useSegments );
const moonMaterial = new THREE.MeshPhongMaterial( {
shininess: 5,
map: textureLoader.load( '/javascripts/threejs/examples/textures/planets/moon_1024.jpg' )
} );
g_TheMoon = new THREE.Mesh( moonGeometry, moonMaterial );
// Set the moon position.
g_TheMoon.position.set( MOON_X_POS, MOON_Y_POS, MOON_Z_POS);
// Add the Moon to the group.
g_TheSolarSystem_group.add(g_TheMoon);
// Enable all layers.
g_TheEarth.layers.enableAll();
g_TheMoon.layers.enableAll();
// -------------------- END : BUILD THE EARTH AND MOON ------------
// Set the position of the solar system.
g_TheSolarSystem_group.position.set( SOLAR_SYSTEM_X_POS, SOLAR_SYSTEM_Y_POS, SOLAR_SYSTEM_Z_POS);
// Add the solar system to the scene.
g_ThreeJsScene.add(g_TheSolarSystem_group);
// --------------------- LIGHTS ----------------------
// Create a light for the solar system.
const light = new THREE.HemisphereLight(0xeeeeff, 0x777788, 1, ); // 0.75);
light.position.set(SOLAR_SYSTEM_X_POS, SOLAR_SYSTEM_Y_POS - 3, SOLAR_SYSTEM_Z_POS);
light.lookAt(g_TheEarth.position);
g_ThreeJsScene.add(light);