Created
September 20, 2020 18:43
-
-
Save Morpholux/f36bae7126f3c646fcdf9515f42ef40c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// renaud.jean-francois(arobas)uqam(point)ca | |
// Syntaxe Processing version 3.5.4 | |
// dimanche, 20 septembre 2020 | |
import garciadelcastillo.dashedlines.*; | |
DashedLines dash; | |
PVector [] pts = new PVector[3]; | |
int dist = 0; | |
void setup() { | |
size(400, 400); | |
noFill(); | |
stroke(255); | |
strokeWeight(3); | |
strokeCap(SQUARE); | |
dash = new DashedLines(this); | |
dash.pattern(20); | |
float radius = 150; | |
pts[0] = new PVector((cos(radians(270)) * radius), (sin(radians(270)) * radius)); | |
pts[1] = new PVector((cos(radians(30)) * radius), (sin(radians(30)) * radius)); | |
pts[2] = new PVector((cos(radians(150)) * radius), (sin(radians(150)) * radius)); | |
} | |
void draw() { | |
background(0); | |
translate(width/2, height/2); | |
dash.triangle(pts[0].x, pts[0].y, pts[1].x, pts[1].y, pts[2].x, pts[2].y); | |
// Animate dashes with 'walking ants' effect | |
dash.offset(dist); | |
dist += 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment