We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Heyo, So I'm new and having trouble making a triangle that spins from the center and all. I want to make a little animated fidget spinner so I'm starting with a triangle. Here's my code so far but the triangle seems good when it's right way up but when it spins it's obviously not and it's late and I can't figure it out.
Thanks.
float velocity = 0.01; float spin = 0;
void setup(){ size(500,500);
}
void draw(){ background(255);
spin += velocity; pushMatrix(); translate(width/2, height/2); noStroke(); fill(0); rotate(spin); triangle(0,-100, 100, 50,-100,50); popMatrix(); noStroke(); fill(255,0,0); ellipse(width/2, height/2, 5, 5);
}
Answers
My code didn't paste very well from Processing....
https://Forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
The triangle you posted does already spin exactly from the center,
it's just not an Equilateral_triangle