Public
Edited
May 14
10 forks
16 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const satObjScale = satSize * world.getGlobeRadius() / EARTH_RADIUS / 2
const satGeometry = new THREE.SphereGeometry(1, 16, 8);
const groupMaterials = {};
world.objectThreeObject(d => {
if (!groupMaterials.hasOwnProperty(d.group)) {
// cache materials
groupMaterials[d.group] = new THREE.MeshLambertMaterial({
color: groupColor(d.group),
transparent: true,
opacity: 0.7
});
}
const obj = new THREE.Mesh(satGeometry, groupMaterials[d.group]);
obj.scale.set(satObjScale, satObjScale, satObjScale);
return obj;
})

// Size existing satellites
world.objectsData().forEach(d => d.__threeObj && d.__threeObj.scale.set(satObjScale, satObjScale, satObjScale))
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
// Update satellite position data
const gmst = satellite.gstime(time);
satelliteDataToShow.forEach(d => {
const eciPos = satellite.propagate(d.satrec, time).position;
if (eciPos) {
const gdPos = satellite.eciToGeodetic(eciPos, gmst);
d.position = {
lat: satellite.radiansToDegrees(gdPos.latitude), // deg
lng: satellite.radiansToDegrees(gdPos.longitude), // deg
altitude: gdPos.height / EARTH_RADIUS // globe radius units
}
}
})
world.objectsData(satelliteDataToShow);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more