Variations on the dodecagon cube ring adding colour and more cubes


Following on from the dodecagon cube ring I coded in Processing in greyscale, adding the colour was, as I guessed, not too difficult using the angle and HSB mode. I opted to get the shades by having the same hue and saturation in a particular cube, while varying the brightness of the 3 shapes representing the sides rather than varying transparency that I used for the greyscale version. The hue was then altered according to the angle location of each cube.

Then I investigated increasing the number of cubes per ring. I tried 24, but it was too many.The cubes were too small the ring became closer to a circle. I think the angular nature is important. The largest number that for me is aesthetically pleasing is 18. That meant altering the basic shape (see things I learnt below). 18 cubes in the ring made it possible to add another ring without it being too small, so 4 in all instead of the 3 from earlier.

After that I played with some variations. These are the variations of images produced this session. I will add the code for some of these tomorrow.

Things I noted and learnt

Because I’m using a semi-transparent rectangle in between each ring the same colour as the background to create some depth, I have to draw the smallest (furthest away) ring first.

Rather than doing anything clever with calculation, I just used trial and error to alter the radius of the rings so that the margin between the rings looked even and pleasing.

For the rings with 18 cubes per ring, I couldn’t work out what the triangles were that would give me the co-ordinates for to vertex FA, but I knew that the x value needed to be a little bit bigger than the value it was for the 12 cubes ring and the y value needed to be a little bit smaller. So rather than wear my brain and interest out, I cheated by simply trying out multiplying by factors close to 1 until it looked right.

I used the scale() function  to switch the colours and the orientation of the cubes. I got this idea from the code I copied from Paulo, but it took some trial and error to understand what is happening. The Processing reference page says “Transformations apply to everything that happens after and subsequent calls to the function multiply the effect.” I imagined that when I called the function then applied the scale it would only apply to that calling of the function, but without adding scale again to change things back then it simply shifted everything after the application of the scale.

scale(-1,-1) for each ring means the colours are flipped in both x and y direction between rings, but all of the cubes are in the same direction. Whereas scale (-1, 1) flips the colours in the x direction only, but makes the cube orientation opposite between rings. If I wanted to get colour flipping and cube direction difference between rings, I would need to control those things separately somehow.


scale(-1,-1) version


scale (-1, 1) version

872 Total Views 1 Views Today

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *