Final Project for Computational Graphics course
View the Project on GitHub fabio-cumbo/computational-graphics-project
This page describes the content of the final project for the course of computational graphics of Professor Paoluzzi of the Roma Tre University. This work contains the following contents:
One of the most famous and simple fractals is the Sierpinski triangle (or Sierpinski Gerla), named after the mathematician who first studied its properties. There are several ways to accomplish this fractal. In this work was applied the cluster method.
The Sierpinski triangle is a fractal cluster, that is obtained from a two-dimensional figure and removing certain portions. Specifically, it starts from an equilateral triangle (called axiom), and a further figure said generator:

At the first step, the original triangle is divided into four triangles of smaller size, among which the central element is removed (the one whose sides are segments jointing the midpoints of the sides of the previous triangle). The procedure is then iteratively repeated over each triangle, until you get the final result. Magnifying only one of the triangles that make up the figure you can see that it is exactly equal to the whole figure. Independently to the depth at which you look at it, the portion of the triangle of level n of the iteration process will give exactly, when scaled by a factor of 2^n, a copy of the entire triangle.

In this project, was created a 3D version of the Gerla, a Sierpinski tetrahedron: The Sierpinski pyramid is the 3D version of a fractal cluster, and follows the same rules of the triangle, with the difference that the "basic block" is formed by a triangular-based pyramid instead of a triangle. At each iteration, the pyramids are replaced by a suitably scaled version of the generator.

Another fractal, very similar in construction to the Sierpinski triangle, is the so-called fractal box. The fractal is generated by five geometric transformations. Each of them is a homothety with reason equal to 1/3 and composed with an appropriate translation.

The fractal is built inside a square and on each of the four sides leads to a copy of the "Cantor Set". In this project has been implemented a three-dimensional version of the fractal box based on the same principles of two-dimensional version described above.
All codes linked above need LAR (Linear Algebraic Representation) for a proper functioning. You can test the code described in this project pasting it in the JavaScript Console in the LAR-DEMO project page.