// rotatedemo D. Parson Feb. 13, 2018 float rotateAmount = 0, rotateSpeed = 1 ; void setup() { size(500,500); background(255); } void draw() { background(255); fill(255,255,0); stroke(0); // If I want to rotate around the center of a triangle, // easiest way is to translate to cernter of the triangle. pushMatrix(); translate(width/2, height/4); rotate(radians(rotateAmount)); triangle(0,-20, -10, 10, 10, 10); rotateAmount = rotateAmount + rotateSpeed ; if (rotateAmount < 0 || rotateAmount >= 360) { rotateAmount = 0 ; } popMatrix(); }