Skip to content

Commit

Permalink
Add backdrop glow
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhanarbek Osmonaliev committed Dec 23, 2021
1 parent d95adf6 commit e81d307
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.js.map

Large diffs are not rendered by default.

20 changes: 5 additions & 15 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ function initGlobe() {
.hexPolygonsData(countries.features)
.hexPolygonResolution(3)
.hexPolygonMargin(0.7)
.showAtmosphere(false)
.showAtmosphere(true)
.atmosphereColor("#3a228a")
.atmosphereAltitude(0.25)
.hexPolygonColor((e) => {
if (
["KGZ", "KOR", "THA", "RUS", "UZB", "IDN", "KAZ", "MYS"].includes(
Expand All @@ -116,6 +118,7 @@ function initGlobe() {
} else return "rgba(255,255,255, 0.7)";
});

// NOTE Arc animations are followed after the globe enters the scene
setTimeout(() => {
Globe.arcsData(travelHistory.flights)
.arcColor((e) => {
Expand Down Expand Up @@ -156,23 +159,10 @@ function initGlobe() {
globeMaterial.emissive = new Color(0x220038);
globeMaterial.emissiveIntensity = 0.1;
globeMaterial.shininess = 0.7;

// NOTE Cool stuff
// globeMaterial.wireframe = true;

// Initialize the glow
var options = {
backside: true,
color: "#3a228a",
size: 100 * 0.25,
power: 6,
coefficient: 0.3,
};
try {
var glowMesh = createGlowMesh(new SphereGeometry(100, 75, 75), options);
Globe.add(glowMesh);
} catch (err) {
console.log("Your threeJS version does not support three-glow-mesh");
}
scene.add(Globe);
}

Expand Down

0 comments on commit e81d307

Please sign in to comment.