diff options
Diffstat (limited to 'index.md')
| -rwxr-xr-x | index.md | 49 |
1 files changed, 24 insertions, 25 deletions
@@ -7,7 +7,7 @@ lang: en While walking through town the other day, I saw a pillar that looks a bit like this: - + In other words, it was a circular vertical column decorated with flat tiles. I got to thinking: how do you make such a column? I would probably @@ -21,7 +21,7 @@ number of tiles. Each tile creates a tiny gap vs. the cylindrical pillar, and those gaps would add up over the circumference of the pillar. Your tiles wouldn't exactly meet up when you get back to where you started! - + There should be a simple, mathematical relation between the circumference of the pillar, and the perimeter of the regular polygon with $n$ @@ -31,7 +31,7 @@ Let's draw a couple pictures. To keep things easy to visualize, we'll look at a case where $n = 3$, but we'll keep our math generalizable to any $n$.  +length $e$.](./images/2026_07_12/Screenshot from 2026-07-12 18-21-54.jpg) Our circle has radius $r$, and the circumscribing polygon has edge length $e$. @@ -41,7 +41,7 @@ precisely, an expression for $\frac{n e}{2 \pi r}$ solely in terms of $n$.) Zooming in on the bottom-right corner of our circle, we can define a few more interesting quantities: - + We define: @@ -53,7 +53,7 @@ We define: Finally, if we focus on the region outlined by $r$, $h$ and the bottom of the polygon: - + We define one final quantity, $\phi$, the interior angle of the right triangle formed by $h-r$ and $r$. @@ -124,7 +124,7 @@ $$ This represents the ratio of these two shapes' circumferences, so we expect that at the limit of n, it should be 1. Therefore we subtract 1 to get an error function. This is the graph of $P/C-1$: - + As expected, the error starts out very large with few tiles, then quickly drops towards 0 (the ratio converging to 1). @@ -139,7 +139,7 @@ proportional to its size $\frac{1}{n}$). > *TODO: I think that this measure of relative error is wrong.* - + Here are the values of $P/C-1$ and $(P/C-1) \cdot n$ for up to 30 tiles: @@ -493,7 +493,7 @@ subject at octahedral lattice points, record them to an atlas, then reconstruct those photos in a particle.  +13-35-40.jpg) ## But why octahedrons? @@ -504,7 +504,7 @@ any trig functions, making it suitable for use in realtime graphics. This is what an octahedron looks like:  +13-54-05.jpg) It is a polyhedron with 8 triangular faces and 6 vertices. The equator is a square. @@ -513,22 +513,22 @@ Let's work out how we'd convert this octahedron to a plane. First, we project the upper hemisphere onto the xz plane:  +plane.](./images/2026_01_14/Screenshot from 2026-01-14 13-50-27.jpg) Next, we effectively need to "rotate" the triangles in the lower half around those diagonal edges. We can cheat by first *reflecting* the bottom vertex of each triangle about its diagonal edge: - + Finally, we can just project those points in the lower hemisphere onto the xz plane: - + Viewed head on, we can see a very beautifully symmetric unwrapping: - + Note that we never actually did any rotations, so there no trig! Here's the same procedure in code: @@ -642,7 +642,7 @@ With this mapping, we can write some code to spawn cameras at the lattice points of an octahedral-mapped hemisphere, pointing in at some target object, and generate an atlas of images taken at different angles: - +  @@ -712,7 +712,7 @@ pretty tightly. Here's Suzanne with that correction in place: Here's the atlas. Pretty tight packing - could probably be optimized a little further though: - + ## Impostor v3 @@ -1117,7 +1117,7 @@ raymarch inside a wholly self contained coordinate system. I've pulled this off, but not in a way which is useful for characters (yet). -{width=80%} +{width=80%} TLDR: @@ -1281,22 +1281,22 @@ geometry freely. Re-bake once you're done and everything just works. 4. Shearing works, but doesn't permit re-baking. -{width=80%} +{width=80%} {width=80%} +re-bake.](./images/2025_06_11/fake_origins_33.jpg){width=80%} {width=80%} +re-bake](./images/2025_06_11/fake_origins_34.jpg){width=80%} -{width=80%} +{width=80%} ## Blender and Unity tooling I've written a Blender plugin to permit myself to bake the vectors and quaternions as described above. -{width=80%} +{width=80%} The plugin supports baking vectors and quaternions on extremely large meshes primarily through caching. If your mesh contains many submeshes that are @@ -1311,7 +1311,7 @@ going through every combo of 90 degrees (64 total) if you run into trouble. Use speed up the process. You can visualize the vectors with my Unity script, which is described below. -{width=80%} +{width=80%} It also supports a bunch of other workflows, mostly designed for the voxel world creation workflow: @@ -1344,7 +1344,7 @@ Put them on a curve and select your instance. Then use the "Pack UV island by submesh Z" plugin tool to actually pack them. {width=80%} +UVs.](./images/2025_06_11/fake_origins_37.jpg){width=80%} Finally, I have a Unity script which lets you visualize the raw baked vectors, and the "corrected" baked vectors, i.e. those rotated with the baked @@ -1355,7 +1355,7 @@ orange ones should converge at the center of each submesh. can correct for that in your SDF.) {width=80%} +Unity.](./images/2025_06_11/fake_origins_39.jpg){width=80%} # how much CO2 do American cars produce? 23 May 2025 @@ -1654,4 +1654,3 @@ second according to the eyeball test. <source src="https://yummers.dev/images/danser.webm" type="video/webm"> me rn </video> - |
