Sierpinski Carpet generation using OpenGL and GLUT library. Written in c++.
Generated by executing:
./bin/main --iterations 6 --width 728
Generated by executing:
./bin/main --iterations 4 --deformation 0.3 --color
To compile the source code execute:
make
or:
g++ src/main.cpp -lGL -lglut -o bin/main
To run the program execute:
./bin/main
--size <size_in_px>
sets the carpet width and height. Thesize_in_px
value must be a power of 3 (default value: 728),--iterations <num_of_iterations>
sets the number of iterations ("the depth of the recursion tree") (default value: 6),--color
sets the color of inner cubes to random values,--deformation <deformation_amount>
randomly deforms the carpet. Thedeformation_amount
must be a floating point number between 0.0 and 1.0. 0.0 means no deformation. 1.0 means that deformation can achieve a maximum value of one inner square (default value: 0.0)--help
prints help text.