Hacker News new | ask | show | jobs
by tppiotrowski 1941 days ago
Excellent write up. I've been using elevation models for the past few months to create real time shadows overlaid on slippy maps using WebGL. [1]

One thing I learned is that if you really want to recreate "real-world" terrain you have to account for the curvature of the earth. Uluru is over 3km wide and I estimate your image is around 5km. Across this distance the earth will curve 2 meters so you could modify the elevation model to drop off a meter gradually from the center to the edges.

[1] https://shademap.app

1 comments

That's ace when it loads, but modifying the time on the bar at the bottom of the screen makes the shadow disappear. I get a NaN in the URL which is presumably related (eg https://shademap.app/#47.62769,24.44286,4z,NaNt). Chrome 88.0.4324.182, OSX, no plugins to speak of. There's a bunch of 404s from Mapbox (eg https://api.mapbox.com/v4/mapbox.terrain-rgb/3/3/6.pngraw?ac...) but no other console errors.
The 404s from Mapbox are for elevation map tiles over the ocean where elevation is assumed to be 0.

As you pan, zoom and change the time, the url updates so you can share a permalink with others and they see exactly what you do. It looks like somehow you got an invalid timestamp (NaNt should be a timestamp: 1614115393106t). Will dig more into this. Thanks.

My date/time code only worked with US date MM/DD/YYYY and not DD/MM/YYYY. Fixed now.

And to think 50% of my traffic this month has been from Europe. A lot of users I won't be getting back...

Thanks for the bug report.