Advanced material options for the earth surface.
Usage
Load the file /modules/miniature.earth.materials.js or copy the code to your script and customize it to your needs.
Earth.Materials.enable.enable( earth )
myearth.addEventListener( 'ready', function( event ) {
Earth.Materials.enable( this );
this.loadNormalMap( 'normals.jpg', 0.8 );
};
Methods
EarthInstance.loadNormalMap( url, strength, complete )
- url
- (string) URL to the normal map
- strength
- (float) Strength of the effect | default: 1.0
- complete
- (function) Load complete callback
Adds details to earth surface. The effect is only visible if earth light = 'sun' or a light is added to the scene.
EarthInstance.loadDisplacementMap( url, strength, complete )
- url
- (string) URL to the displacement map
- strength
- (float) The height of the mountains | default: 1.0
- complete
- (function) Load complete callback
Changes the geometry of the earth surface.
EarthInstance.addMapLayer( url, offset, complete, alpha_only, color )
- url
- (string) URL to the image
- offset
- (float) Distance to the earth surface
- complete
- (function) Load complete callback
- alpha_map
- (boolean) If true, the image is treated as alpha map (dark colors become transparent) | default: false
- color
- (color) The color is multiplied to the image | default: #FFFFFF
Adds a sphere with a transparent image around the earth, for example to display a layer of clouds.