回転する三角形のスタンプ
/** * rotating triangle stamp * * @author aa_debdeb * @date 2016/03/08 */ void setup(){ size(640, 640); background(30); fill(0); stroke(255); strokeWeight(1); } void draw(){ if(mousePressed){ translate(mouseX, mouseY); rotate(frameCount * 0.1); float speed = sqrt(sq(mouseX - pmouseX) + sq(mouseY - pmouseY)); scale(map(speed, 0, 50, 3, 1)); triangle(0, 0, 30, 0, 20, 10); } }