Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float X=0;
- float Y=0;
- float A=480;
- void gasket(float x, float y, float a, int num) {
- if (num < 1) {
- return;
- }
- float h = sqrt(3) * a / 2;
- triangle(
- x + a / 2, y,
- x, y + h,
- x + a, y + h
- );
- num--;
- gasket(x + a/4, y, a/2, num);
- gasket(x, y+h/2, a/2, num);
- gasket(x + a/2, y+h/2, a/2, num);
- }
- void setup() {
- size(480, 420);
- smooth();
- noLoop();
- }
- void draw() {
- gasket(X, Y, A, 7);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement