diff --git a/site/cellthing.html b/site/cellthing.html
index 4e21216..b137b18 100644
--- a/site/cellthing.html
+++ b/site/cellthing.html
@@ -21,17 +21,17 @@ The world consists of a grid of cells, and you can create new cell types and ass
The engine randomly finds places where the one of your rules' input (left) picture matches a place in the world, and replaces it with the output (right) picture.
-
+
groups
A rule can also have cells containing a group. On the input side, that cell will match anything in the group, and on the output side it will become a random cell from the group. A diagonal line through the group icon means that it can also match on positions outside the world, where there are no cells.
-
+
copy cells
On the output side, a cell can be set to copy the contents of one cell from the input side, this is useful for applying the same rule to several cell types without randomly swapping between them on the output
-
+
random is easy, right?
@@ -43,7 +43,7 @@ A rule can have blank cells. On the input side, this means it will matc
worm
Let's say I make a rule for a little worm that moves to the right, this works fine. Its head disappears out of the world because the cell in front of the head in the input pattern is blank, which matches anything, including out of bounds. To make it stop just before the edge, you could set that rule cell to air.
-
+
Now if I want it to do the same thing in but to the left, I can simply draw the rule and worm in the other direction, right?
Almost. It no longer moves past the edge.
@@ -66,7 +66,7 @@ Once at the start, the engine checks every possible position and every rule, and
Now, how should it even use that information? The first thing I tried was to randomly pick one of all the matches. This kind of works but leads to the simulation speed being dependent on the number of matches, so for example sand falls slower if there is a lot of sand that hasn't landed yet.
-
+
I got a slightly more even result by multiplying the speed (number of rule executions per frame) by the total number of matches, but this is not a perfect solution as it does not take into account overlapping matches. A cell contained in several rule matches would be more likely to be affected, which in some cases can lead to weird bias (see just one more implementation)
@@ -80,7 +80,7 @@ So now the engine picks a random position, then checks the cache and picks a ran
I want to simulate a swarm of bees, so I create a rule for a bee moving by one cell, and enable rotate so it works in all directions. That was easy,
-
+
Oh no, the swarm is moving toward the top left instead of spreading equally. But I can see that the bees move in all four directions, so the rule seems to be rotated correctly.
@@ -90,10 +90,14 @@ I was stuck on this problem for quite a while, and it only happened with the new
The movement rule has these variants:
-
+
+
+
Each rule has its origin point in the top-left cell.
In the diagram below, the bee would move left when the left (purple) cell is picked by the engine, and up when the top (green) cell is picked.
-
+
+
+
But to move right or down, it needs the bees own position to be picked by the engine, since the rules always extend right-down. That means when the engine picks the bee's position, there are two possible rules to execute. Therefore, moving right and down both have half the probability overall compared to moving up or left.
the overlap checker
@@ -104,7 +108,7 @@ In this version, the cache is not only searched for matches at the chos
Since the root issue was caused by asymmetry, I thought this implementation should be correct. This one was actually my first instinct when I created the cache, but as a friend suggested, an absolute-position based checker seemed (and indeed was) more performant and simpler, so I did that one first.
-
+
Now the bees are evenly distributed, just like real bees!(false)
@@ -114,7 +118,7 @@ Now the bees are evenly distributed, just like real bees!(false)
While I was trying to figure out the reason for the directional bias in the previous implementation, I realised that the overlap checker also has biases. The probability of any given cached match to be executed is dependent on its area, which is not very intuitive. Two objects of different mass fall at different speeds, and adding empty padding to a rule makes it run faster.
-
+
Ideally the red, pink and blue cells should all fall at around the same rate, but the red sand always lands first and the pink last.
@@ -125,7 +129,7 @@ Alright, the Final (I hope) implementation stores an origin offset for
fin
If you somehow read through all that, congratulations I think? Now enjoy this fire:
-
+
Download the thing and make something fun: git.crispypin.cc/CrispyPin/snad
diff --git a/site/horological-crimes.html b/site/horological-crimes.html
index 0d41a0f..18d90e5 100644
--- a/site/horological-crimes.html
+++ b/site/horological-crimes.html
@@ -27,7 +27,7 @@ TODO front image
On a whim I decided to see if I could figure out what was wrong and attempt to fix it. How hard could that possibly be?
-
+
I am a professional
@@ -41,8 +41,8 @@ I stripped a short length of cable-tie into a 0.5mm diameter wire, bent it into
And to hold the wire in place, I used hot glue because I don't respect the Art of Watchmaking have anything better.
-
-
+
+
This seems to have worked pretty well as far as i can tell from winding up the clock and poking around. That gear is not moving sideways anymore and can rotate easily.
@@ -63,8 +63,8 @@ This is where I'm currently stuck, and most likely I'll abandon it forever. I do
I tried to create a part that would hold the thicker(0.5mm) part of the gear, just below the bearing, but it's too tight against the rest of the parts. I'm sure that's possible with better tools but i'm out here using a cable tie wire as a drill and a plastic scrap instead of brass. It was fun but ultimately too difficult with no good tools.
-
-
+
+
maybe one day i will ocme back to this project and fix it, maybe not. It was fun anyway
diff --git a/site/index.html b/site/index.html
index 61da491..ac4d38c 100644
--- a/site/index.html
+++ b/site/index.html
@@ -31,6 +31,7 @@ this means it is
- snad (cell thing)
- keyboar
- distracting
+- old projects
- todo: put more words in the computer
+2021-05-26
+This page is a collection of fractal renderers I made in JS for a school assignment back in 2020.
+This is the only JS on this website.
+
+
Tree fractal
+
+The splitting angle is defined by the mouses x position. The number of iterations is set in the first input field (default is 12). Each branch is slightly smaller than its parent, the factor is the second input field. Click the canvas to pause/resume the image.
+
+
+
+
+
+
+
+
+
Mandelbrot set
+
+Wikipedia page
+You can click to zoom and set the iteration count in the input field.
+
+
+
+
+
+
+
+
+
Multibrot set
+
+Wikipedia page
+You can click to zoom and set the iteration count in the input field. The second input controls the exponent.
+
+
+This is quite slow to render.
+
+
+
+
+
+
+
+
+
+
Interactive Julia set
+
+Wikipedia page
+You can set the iteration count in the input field.
+
+I made a voxel engine in rust to learn rust and godot-rust as well as explore voxel systems. It has (practically) infinite terrain generation, lets you place and remove voxels and supports transparent voxel types. The main point was to develop an optimised meshing algorithm.
+
+This one I actually wrote a post about here
+
+OVR Utils is a VR overlay application that has some useful tools for SteamVR.
+I wanted an overlay that could tell me the time without having to open the steam dashboard, and to see the battery levels of my controllers easily, but couldn't find one for free that also had Linux support. So I decided to create my own, and also wrote down a long list of other useful tools. So far only a few of these have been implemented, such as the image overlay and the keyboard.
+
+
+
+
\ No newline at end of file
diff --git a/site/projects/raymarched-voxels.png b/site/projects/raymarched-voxels.png
new file mode 100644
index 0000000..58beffd
Binary files /dev/null and b/site/projects/raymarched-voxels.png differ
diff --git a/site/projects/voxel_media/demo.mp4 b/site/projects/voxel_media/demo.mp4
new file mode 100644
index 0000000..7a4721a
Binary files /dev/null and b/site/projects/voxel_media/demo.mp4 differ
diff --git a/site/projects/voxel_media/demo2.mp4 b/site/projects/voxel_media/demo2.mp4
new file mode 100644
index 0000000..8bb15cc
Binary files /dev/null and b/site/projects/voxel_media/demo2.mp4 differ
diff --git a/site/projects/voxel_media/fig1.png b/site/projects/voxel_media/fig1.png
new file mode 100644
index 0000000..3139fc1
Binary files /dev/null and b/site/projects/voxel_media/fig1.png differ
diff --git a/site/projects/voxel_media/fig2.png b/site/projects/voxel_media/fig2.png
new file mode 100644
index 0000000..78bd96c
Binary files /dev/null and b/site/projects/voxel_media/fig2.png differ
diff --git a/site/projects/voxel_media/fig3.png b/site/projects/voxel_media/fig3.png
new file mode 100644
index 0000000..ab400b6
Binary files /dev/null and b/site/projects/voxel_media/fig3.png differ
diff --git a/site/projects/voxels.html b/site/projects/voxels.html
new file mode 100644
index 0000000..2fe2ba5
--- /dev/null
+++ b/site/projects/voxels.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ something silly - voxels
+
+
+
+
+
+
+
Voxel engine in Godot 3 with Rust
+
+2022-05-05
+I made a voxel engine in rust to learn rust and godot-rust as well as explore voxel systems. It has (practically) infinite terrain generation, lets you place and remove voxels and supports transparent voxel types. The main point was to develop an optimised meshing algorithm.
+
+
+
+Demo of fast terrain generation
+
+Optimised mesh visualisation
+
+
Optimised/greedy mesh algorithm
+
+editor's note: This writeup was never finished :D
+
+
+The algorithm I'm using is one I made myself, inspired by a few others. I could not find an easy to understand explanation of how to do it but this artice and this article gave me somewhere to start.
+
+
+In this explanation I will assume basic knowledge of how meshes work and how to do the simplest form of culling for voxel meshes.
+
+fig. 1: example set of voxels, with the simplest form of mesh generation applied.
+
+
+To start off, we can break down the problem to 2 dimensions by recognising that each direction along the axis as well as each layer along those directions is independent. We then only have to process a single 2D slice of the voxel domain at once.
+
+
+
+fig. 2: The algorithm only needs to consider one layer and direction at a time, highlighted in green
+
+
+The first step is to generate "strips", essentially create long quads that cover connected voxels. We can loop through the plane and keep track of at most one active strip. The active strip is the last one started and we grow it as more voxels under it are traversed. In the inner loop we check the voxel at that position as well as the one above. With this we can determine if we need to stop the current strip, start a new one or do nothing. If there is not currently an active strip, a new one should be created when the voxel below is filled and the one above is empty (an exposed surface).
+
+
+
+fig.3: Long strips of adjacent voxels can be merged into fewer, long quads.
+
+
+
+
\ No newline at end of file
diff --git a/write/cellthing.md b/write/cellthing.md
index 09b56dd..29a4890 100644
--- a/write/cellthing.md
+++ b/write/cellthing.md
@@ -25,7 +25,7 @@ A rule can have *blank* cells. On the input side, this means it will match anyth
Let's say I make a rule for a little worm that moves to the right, this works fine. Its head disappears out of the world because the cell in front of the head in the *input* pattern is blank, which matches anything, including out of bounds. To make it stop just before the edge, you could set that rule cell to air.
Now if I want it to do the same thing in but to the left, I can simply draw the rule and worm in the other direction, right?
-
+
Almost. It no longer moves past the edge.
When a rule and position is chosen, the top-left of the rule is aligned with that position. In the example above, the rule would have to start from outside the world to make the worm continue one more step.
@@ -58,9 +58,11 @@ I was stuck on this problem for quite a while, and it only happened with the new
The movement rule has these variants:
+
Each rule has its origin point in the top-left cell.
In the diagram below, the bee would move left when the left (purple) cell is picked by the engine, and up when the top (green) cell is picked.
+
But to move right or down, it needs the bees own position to be picked by the engine, since the rules always extend right-down. That means when the engine picks the bee's position, there are *two* possible rules to execute. Therefore, moving right and down both have half the probability overall compared to moving up or left.
diff --git a/write/index.md b/write/index.md
index 8ce29e4..73e128a 100644
--- a/write/index.md
+++ b/write/index.md
@@ -15,6 +15,7 @@ this means it is
- [snad (cell thing)](/cellthing)
- [keyboar](/keyboards-are-fun)
- [distracting](/humans/distracting)
+- [old projects](/projects/old-project-list)
- todo: put more words in the computer
[other sites](/internets)
diff --git a/write/projects/fractals.md b/write/projects/fractals.md
new file mode 100644
index 0000000..41caa47
--- /dev/null
+++ b/write/projects/fractals.md
@@ -0,0 +1,53 @@
+# Fractals
+`2021-05-26`
+This page is a collection of fractal renderers I made in JS for a school assignment back in 2020.
+This is the *only* JS on this website.
+
+## Tree fractal
+The splitting angle is defined by the mouses x position. The number of iterations is set in the first input field (default is 12). Each branch is slightly smaller than its parent, the factor is the second input field. Click the canvas to pause/resume the image.
+
+
+
+
+
+
+
+
+## Mandelbrot set
+[Wikipedia page](https://en.wikipedia.org/wiki/Mandelbrot_set)
+You can click to zoom and set the iteration count in the input field.
+
+
+
+
+
+
+
+
+## Multibrot set
+[Wikipedia page](https://en.wikipedia.org/wiki/Multibrot_set)
+You can click to zoom and set the iteration count in the input field. The second input controls the exponent.
+
+This is quite slow to render.
+
+
+
+
+
+
+
+
+
+## Interactive Julia set
+[Wikipedia page](https://en.wikipedia.org/wiki/Julia_set)
+You can set the iteration count in the input field.
+
+
+
+
+
+
+
+
+
+
diff --git a/write/projects/old-project-list.md b/write/projects/old-project-list.md
new file mode 100644
index 0000000..55e4993
--- /dev/null
+++ b/write/projects/old-project-list.md
@@ -0,0 +1,49 @@
+# projects
+`2024-07-06`
+Some older projects that were created before this blog
+
+### Voxel engine in Godot 3 + Rust
+start: `2022-04-19`
+last update: `2022-05-05`
+source: [github.com/CrispyPin/gd-voxel-rs](https://github.com/CrispyPin/gd-voxel-rs)
+
+I made a voxel engine in rust to learn rust and godot-rust as well as explore voxel systems. It has (practically) infinite terrain generation, lets you place and remove voxels and supports transparent voxel types. The main point was to develop an optimised meshing algorithm.
+
+This one I actually wrote a post about [here](/projects/voxels)
+
+### OVR Utils
+start: `2021-05-14`
+last update: `2022-05-08`
+source: [github.com/CrispyPin/ovr-utils](https://github.com/CrispyPin/ovr-utils)
+
+OVR Utils is a VR overlay application that has some useful tools for SteamVR.
+I wanted an overlay that could tell me the time without having to open the steam dashboard, and to see the battery levels of my controllers easily, but couldn't find one for free that also had Linux support. So I decided to create my own, and also wrote down a long list of other useful tools. So far only a few of these have been implemented, such as the image overlay and the keyboard.
+
+### Raymarched voxel rendering
+start: `2021-04-18`
+last update: `2021-04-29`
+source: [github.com/CrispyPin/voxel-raymarcher](https://github.com/CrispyPin/voxel-raymarcher)
+
+A raymarched voxel renderer made with a Godot shader.
+
+
+### Game of Life wallpaper
+start: `2021-03-21`
+last update: `2022-02-22`
+source: [github.com/CrispyPin/gol-wallpaper](https://github.com/CrispyPin/gol-wallpaper/)
+
+This is hosted on github pages at [gol.crispypin.cc](https://gol.crispypin.cc/?cellsize=5&time=2&margin=0&populate=true)
+
+
+### Fractals
+start: `2020-03-04`
+last update: `2020-05-19`
+source: [github.com/CrispyPin/Webb-1-Projekt/](https://github.com/CrispyPin/Webb-1-Projekt/)
+
+While I was learning web development and JavaScript I made a page with fractals.
+It has now been moved [here](/projects/fractals)
+
+
+
+
+back to [more recent stuff](/)
diff --git a/write/projects/voxels.md b/write/projects/voxels.md
new file mode 100644
index 0000000..d75c9a0
--- /dev/null
+++ b/write/projects/voxels.md
@@ -0,0 +1,31 @@
+# Voxel engine in Godot 3 with Rust
+`2022-05-05`
+I made a voxel engine in rust to learn rust and godot-rust as well as explore voxel systems. It has (practically) infinite terrain generation, lets you place and remove voxels and supports transparent voxel types. The main point was to develop an optimised meshing algorithm.
+
+
+Demo of fast terrain generation
+
+Optimised mesh visualisation
+
+## Optimised/greedy mesh algorithm
+editor's note: This writeup was never finished :D
+
+The algorithm I'm using is one I made myself, inspired by a few others. I could not find an easy to understand explanation of how to do it but [this artice](https://vercidium.com/blog/voxel-world-optimisations/) and [this article](https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/) gave me somewhere to start.
+
+In this explanation I will assume basic knowledge of how meshes work and how to do the simplest form of culling for voxel meshes.
+
+fig. 1: example set of voxels, with the simplest form of mesh generation applied.
+
+To start off, we can break down the problem to 2 dimensions by recognising that each direction along the axis as well as each layer along those directions is independent. We then only have to process a single 2D slice of the voxel domain at once.
+
+
+fig. 2: The algorithm only needs to consider one layer and direction at a time, highlighted in green
+
+The first step is to generate "strips", essentially create long quads that cover connected voxels. We can loop through the plane and keep track of at most one active strip. The active strip is the last one started and we grow it as more voxels under it are traversed. In the inner loop we check the voxel at that position as well as the one above. With this we can determine if we need to stop the current strip, start a new one or do nothing. If there is not currently an active strip, a new one should be created when the voxel below is filled and the one above is empty (an exposed surface).
+
+
+fig.3: Long strips of adjacent voxels can be merged into fewer, long quads.
+
+.
+
+this was incomprehensible, take me [home](/)
\ No newline at end of file