We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to create a little speedometer for my project, which requires the pointer (a triangle) to rotate depending on a variable. I can rotate it if it is translated to the center, but when I try to move it on to the speedometer dial, it seems a little random. Is there an equation to use to put it back in the same place each time no matter its angle? I've since use a technique that draw a triangle directly at a different angle each time, but the results also seem random. Here's the current code:
PImage speedo; //this is the dial
speedo = loadImage("speedo.png");
triangle(x,y,x+3,y+30,x-3,y+30);//30 is the value that would need to be modified to rotate correctly, if I understood