Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
globeObj.rotation.y = -Math.PI / 2; // face prime meridian along Z axis
globeObj.__globeObjType = 'globe'; // Add object type
// create atmosphere
const atmosphereObj = createGlowMesh(globeObj.geometry, {
backside: true,
color: 'lightskyblue',
size: GLOBE_RADIUS * 0.15,
power: 3.5, // dispersion
coefficient: 0.1
});
atmosphereObj.__globeObjType = 'atmosphere'; // Add object type
// create graticules
const graticulesObj = new THREE.LineSegments(
new GeoJsonGeometry(geoGraticule10(), GLOBE_RADIUS, 2),
new THREE.LineBasicMaterial({ color: 'lightgrey', transparent: true, opacity: 0.1 })
);
return {
globeObj,
atmosphereObj,
graticulesObj
}
},
const applyUpdate = td => {
const { alt } = obj.__currentTargetD = td;
conicObj.geometry = new ConicPolygonBufferGeometry(coords, GLOBE_RADIUS, GLOBE_RADIUS * (1 + alt), false);
addStroke && (strokeObj.geometry = new GeoJsonGeometry(geoJsonGeometry, GLOBE_RADIUS * (1 + alt + 1e-4))); // stroke slightly above the conic mesh
};