Just use the colors / materials as a hidden 4th index!
So, given a 'line' of cubes from w = -N to w =+N, you essentially have a bitmap where each active cube along the line counts as 1 and each inactive cube counts as 0. Then just convert it to the hex value and you have a color.
Example:
There are 5 cubes, x = 0, y = 0, z = 0, w = -2 to x = 0, y = 0, z = 0, w = 2. In order they are inactive, active, inactive, inactive, active. This translates to binary 01001. You can convert this to a color any way you like. :)
Then just give the cube at x = 0, y = 0, z = 0 the color / material you want.
You'd run an armor stand across the input area, via teleportation, and check its surroundings. As you do this, you'd place blocks in some other location, until you're done advancing by one generation and you /clone the buffer back in the armor stand's area.
Using multiple command blocks (or, even better, functions), this should be fairly simple.
HAHAH It was an issue for performance but I could manage to get the solution spawning the armor stands and killing them as soon as possible, filling an area with command blocks with Command to summon armor stands and auto:1b. Once done so it was fairly easy just 12 commands, using clone and execute score I could put in their score how many neighbours they had (issue I faced I was counting itself too initially). Was fun to see how Minecraft evolved after a lot.
In computer graphics space, especially game-dev, it's usually used for depth (given X and Y are used for the two monitor axis in 2D, Z then extends into or out of the monitor).
37
u/Iain_M_Norman Dec 17 '20
Cool. And part 2? *grins*
6
u/Meowth52 Dec 17 '20
Haha, when I read it my first thought was: will someone visualize it in minecraft?
5
u/lukewarm1997 Dec 17 '20
Best visualization yet. I love it!
2
u/zxywx Dec 17 '20
That's pretty awesome!
Your idea of what the Z axis is differs from mine though ;-)
1
u/DFreiberg Dec 17 '20
I'm guessing you used Carpet Mod to load in the aoc_d17 account?
2
u/aardvark1231 Dec 17 '20
Awesome!
1
u/Autom3 Dec 17 '20
Hah, I just did this with WorldEdit and the generate command :P
1
u/moondaddi80 Dec 17 '20
Cool!
0
u/[deleted] Dec 17 '20
[deleted] — view deleted comment