DEV Community

Justin
Justin

Posted on

Feature update.. POV mode

If you own an Apple TV you'd know they like to show screen savers of drone shots and what looks like a 4k video from the ISS showing the globe and horizon so today I added POV mode for any satellite.

This as usual proved to be more challenging than expected. Just stick the camera on the satellite, right? how hard could that be.

Firstly, the camera has to face in some direction. At first I figured facing it in the direction of travel would be sensible but this turned out to be confusing for geo-synchronous satellites whose direction of travel in earth fixed frame is not really travel at all. So for "slow" satellites, the better default camera was looking towards earth.

After implementing a pan/tilt of the pretend camera, I then struck 3d math issues. What is "up" in space even anyway? On a LEO satellite, up can be the vector from origin of earth to satellite, this is roughly orthogonal to direction of motion but on geo satellites that causes a maths collapse as "up" being too close to same as "where I am looking" doesn't work too well.

Another problem was that the spherical earth is not tessellated well for a lovely horizon view, it looked like a geodesic dome! so this required switching to high tessellation when switching into POV mode.

The next challenge was accelerated time travel reveals the approximations between satellite fixes made the camera jump at every new exact fix. So I had to re-calculate (just for the POV satellite) on every frame, the full SGP4.

As it stands the new feature is getting there. Pan/tilt works. No zoom yet. The earth looks good below in "4k" globe mode. No atmosphere. The sun and moon are impossibly small. That needs to be fixed. In fact the whole sun/moon thing (apparent size in all modes) needs re-doing, really. No mobile touch controls for the pretend webcam, yet.

The sim also showed the moon almost on top of the sun for my location (and is almost completely un-lit) and I thought that was a bug but it turns out from here at least, the moon is, in fact, almost eclipsing the sun. A few degrees away in altitude and azimuth.

You can get into POV mode from the last Actions button of a satellite info panel:

Well, happy with this new mode. A lot of things still to touch up however. No good feature goes unpunished!

Top comments (0)