Art Diary: March and April 2022

This entry is part 7 of 8 in the series Art Diary

Art Diary: March and April 2022

At the end of my last art diary I mentioned that I would be overhauling my code and I have made a number of big changes to my code. I have split the different types of functions used in the code into four types, action, build, camera and display. The names make it easier to tell what order things happen in because they happen in alphabetical order. Action functions are permanent from one frame to another whilst camera functions belong to sections and are applied to all the objects in that section.

Camera functions are intended to be really important things like projecting from 3-D to 2-D. Then build and display will happen before and after these respectively. All of these different types of function are useful in different ways for complicated graphics. I’m also hoping that having simple names will make explaining and documenting everything more streamlined. I had been using some terrible function names in the past. My code is much easier to read now.

Here is an example of what I have now been able to produce. This is the Lorenz attractor and is an iconic image from the mathematical study of dynamical systems and chaos. The rotating video is a really nice way to see the full structure of the shape.

So far my code only works reliably with points and lines. Here is another example of 3-D graphics with some polyhedrons.

Unfortunately I have had less luck when trying to draw solid objects. Graphics in three dimensions is even harder than I imagined. To draw the above meshes, you only need to calculate the projection of all the points. To fill in the sides of the polygons you avoid drawing the polygons in the wrong order, and the right order is hard to calculate. There are several ways to solve this problem, but I haven’t had time to implement any of them yet. The example below shows what goes wrong when you don’t sort the polygons in the right order.


Obviously this will take more work, and I’m going to continue my work on 3-D graphics. I still have a lot to learn about the differences between two and three dimensions.

After that my next target for the next two months is to test all of my old code and applications in the new package. If this is successful, I would like to get my instagram page back up and running. I have missed the challenge of trying to produce a new piece of art every day.

Series Navigation<< Art Diary: January and February 2022Art Diary: May and June 2022 >>