Hi. I am trying to horizontally flip a triangle and have it placed on the canvas. I want to create buttons for a carousel slide… Here’s the code:
//Buttons
noStroke();
triangle(triangleRX1, triangleRY1, triangleRX2and3, triangleRY2, triangleRX2and3, triangleRY3);
pushMatrix();
translate(1053.75, 0);
rotate(radians(180));
translate(width/2,height/2);
triangle(triangleRX1, triangleRY1, triangleRX2and3, triangleRY2, triangleRX2and3, triangleRY3);
popMatrix();
If it were a rectangle I could have kept the origin at the center using rectmode(). Unfortunately, for a triangle, I don’t know how the rotate function is supposed to work. What am I doing wrong?
Here’s a zipped version of the processing file if that helps: