Devlog #5 — The JavaScript begins. It’s a lot.Okay. JavaScript. Here we go.Started
wiring up the actual logic today. First thing: fetching the TLE data —
basically the orbital parameters that tell satellite.js where the ISS
is. Hitting the wheretheiss.at
API, parsing the two lines, feeding them into
satellite.twoline2satrec(). If it fails, the LED goes red. If it works,
green. Simple.Then stateAt() — takes a date, runs
the SGP4 propagation, converts ECI coordinates to geodetic
(lat/lng/altitude). That’s the core of the whole tracker. One function,
does a lot.Also wrote sun position math from
scratch. Like actual astronomy math — Julian dates, ecliptic longitude,
Earth’s axial tilt. Did not expect to be doing orbital mechanics today.
The issSunlit() function checks if the ISS is in Earth’s shadow using a
dot product. Python brain kicked in here, vector math felt familiar at
least.Then the globe. globe.gl
is actually pretty nice to work with. Night texture, bump map,
atmosphere, star background. Hooked up the HTML markers for the ISS and
observer position.Found a few bugs while writing
this. Typo in a texture URL — hree-globe instead of three-globe, and
earh-blue-marble instead of earth-blue-marble. Also a missing closing
parenthesis somewhere in the globe chain that’s going to cause a syntax
error. Classic late night coding stuff.JavaScript
is definitely harder than HTML and CSS. But the Python background helps
more than I expected — the logic side of it feels familiar, just
different syntax.I changed my mind about the design and I changed to blue.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.