diff --git a/content/sundries/a-very-digital-artifact/blurred_scaled_hm_3.png b/content/sundries/a-very-digital-artifact/blurred_scaled_hm_3.png new file mode 100644 index 0000000..6f9edf5 Binary files /dev/null and b/content/sundries/a-very-digital-artifact/blurred_scaled_hm_3.png differ diff --git a/content/sundries/a-very-digital-artifact/index.md b/content/sundries/a-very-digital-artifact/index.md index 9fc6b1b..99ba9cf 100644 --- a/content/sundries/a-very-digital-artifact/index.md +++ b/content/sundries/a-very-digital-artifact/index.md @@ -100,10 +100,10 @@ But at that moment, I had nothing at all. Time to get some data and see if I can # Public data -My first impulse was to search [USGS](https://usgs.gov)'s website for -[heightmap](https://en.wikipedia.org/wiki/Heightmap) data, but I wound up not finding anything -appropriate. Searching now with the wisdom of experience and hindsight, I found this, which would -have been perfect: +My first impulse was to search [USGS](https://usgs.gov)'s website for [digital elevation +map](https://en.wikipedia.org/wiki/Digital_elevation_model) data, but I wound up not finding +anything appropriate. Searching now with the wisdom of experience and hindsight, I found this, which +would have been perfect: [https://apps.nationalmap.gov/downloader/](https://apps.nationalmap.gov/downloader/) @@ -113,8 +113,8 @@ many, many missteps. ## From space? -Anyway, having not found anything I could really use from the USGS, I found [this -site](https://portal.opentopography.org/raster?opentopoID=OTSRTM.082015.4326.1), from +Anyway, having not found anything I could really use from the USGS through all fault of my own, I +found [this site](https://portal.opentopography.org/raster?opentopoID=OTSRTM.082015.4326.1), from OpenTopography, an organization run by the UCSD Supercomputer Center, under a grant from the National Science Foundation. So, still hooray for public data! @@ -431,7 +431,7 @@ as tall as another thing, that will still be true after being scaled), so in a s "accurate" (*note: more foreshadowing*). Once I had the PNG file, I used the [ImageMagick](https://imagemagick.org/script/convert.php) `convert` -command to scale the file down to a reasonable size. Finally, I had something I could use to make a +command to resize the file down to a reasonable size. Finally, I had something I could use to make a mesh: ![the heightmap made by doing a linear scale of height to brightness][scaled_heightmap] @@ -440,16 +440,45 @@ Pretty cool, right? I thought so! The detail is pretty great; that bright spot n [Mt. Shasta](https://en.wikipedia.org/wiki/Mount_Shasta), for example; [Mt. Whitney](https://en.wikipedia.org/wiki/Mount_Whitney) is slightly taller, but not by much, and is part of a range so it doesn't stand out the way Shasta does. It was time to start making some 3D -geometry with the heightmap! +geometry with the heightmap[^time-to-mesh]! # A mesh is born +My next step was to figure out how exactly to turn that heightmap into a mesh. Some searching +assured me that [Blender](https://www.blender.org/), a free and open source 3D modeling package that +I'd dabbled with before, would work well. For example, here's a pretty high-level walk-through of +[how to use a heightmap to displace a mesh +plane](https://alanedwardes.com/blog/posts/create-meshes-from-height-maps-using-blender/), which is +definitely the first step I needed to take. Before too long, I had something that looked like this: +![a very pointy california topo][pointy-california] + +At first glance, it looks OK, but there's so. much. detail. And it's very, very pointy; it just +looks jagged. Check out this close-up detail of Mt. Shasta: + +![a very pointy mt shasta][pointy-shasta] + +You can tell that would not be pleasant to touch, and being able to run your fingers along the shape +was a huge part of the appeal of the artifact. + +## Back to the realm of images + +Given that it seemed like there were a couple semi-related problems with there being too much +detail, my first thought was to blur the heightmap, and then reduce the size of it. I used the +ImageMagick `convert` command [to blur the image](https://legacy.imagemagick.org/Usage/blur/) a +couple rounds, and then resized it down: + +![first attempt at blurring the heightmap][blurry-linear-hm] + +This was a little better, but still not great. A few more rounds of blurring and shrinking got me +this: + +![second round of blurring the heightmap][blurry-linear-hm-smaller] + +With that version, I was able to produce some reasonably smooth-looking geometry in Blender: # Test prints -## Back to the realm of the image - # Final cut # Thank yous, lessons learned, and open questions @@ -481,6 +510,14 @@ given how much I had to blur and decimate)? [scaled_heightmap]: scaled_heightmap.png "the heightmap made by doing a linear mapping of height to brightness" +[pointy-california]: pointy_california_blending.png "the displaced mesh plane made from the first heightmap" + +[pointy-shasta]: pointy_shasta_close-up.png "a very pointy mt shasta" + +[blurry-linear-hm]: blurred_scaled_hm_3.png "first attempt at blurred heightmap" + +[blurry-linear-hm-smaller]: lo-rez_blurred_hm3.png "second round of blurring the heightmap" + [^introspection]: The conclusion upon examination was, "I just wasn't thinking". [^math-computers]: I'm pretty sure this is more "represent shapes with math" than with a computer, but @@ -507,3 +544,9 @@ so there you go. the end product was the point, but I assured him that every step I took was trying to get to the end product as quickly and straightforwardly as possible. Still, I did in fact wind up learning a whole shitload of stuff, which is nice, I GUESS. + +[^time-to-mesh]: Based on the timestamps of the files in the directory where I was working on this +project, it took about ten days from the time I first downloaded a geotiff dataset to having the +heightmap shown above, so you can imagine all the dead-ends I went down and did not share in this +write-up. + diff --git a/content/sundries/a-very-digital-artifact/lo-rez_blurred_hm3.png b/content/sundries/a-very-digital-artifact/lo-rez_blurred_hm3.png new file mode 100644 index 0000000..a3adb8b Binary files /dev/null and b/content/sundries/a-very-digital-artifact/lo-rez_blurred_hm3.png differ diff --git a/content/sundries/a-very-digital-artifact/pointy_california_blending.png b/content/sundries/a-very-digital-artifact/pointy_california_blending.png new file mode 100644 index 0000000..c1ae135 Binary files /dev/null and b/content/sundries/a-very-digital-artifact/pointy_california_blending.png differ diff --git a/content/sundries/a-very-digital-artifact/pointy_shasta_close-up.png b/content/sundries/a-very-digital-artifact/pointy_shasta_close-up.png new file mode 100644 index 0000000..f390864 Binary files /dev/null and b/content/sundries/a-very-digital-artifact/pointy_shasta_close-up.png differ diff --git a/content/sundries/a-very-digital-artifact/scaled_heightmap.png b/content/sundries/a-very-digital-artifact/scaled_heightmap.png index 84e5e4f..7520a48 100644 Binary files a/content/sundries/a-very-digital-artifact/scaled_heightmap.png and b/content/sundries/a-very-digital-artifact/scaled_heightmap.png differ