Shattered Polygon
A downloadable asset pack
My first entry! This code returns a polygon randomly spliced with a pastel color pattern. Click the 'K' or 'J' key to move back and forth between different versions of the randomly cut polygon. If you want to use a different polygon (any convex polygon can be used), change the polygon variable, p0, in drawShattered(). A polygon is a list of tuples with points. Each tuple is a line segment of the polygon, and the line segments should be listed counterclockwise. If you want to change the color scheme, change the hex color numbers in randomPastel() with whatever you like, or create your own random color function. This can be applied to people working in design (for instance, stained glass windows) and mathematics (working in topology or with sets, shapes, etc.).
Download
Install instructions
Download this file and run it in a code editor or IDE. At the top of the file, the code imports p5, so make sure you have the p5 Python library.
p5 installation: https://p5.readthedocs.io/en/latest/install.html
Leave a comment
Log in with itch.io to leave a comment.