rotate 180 degrees / shift values
in
Programming Questions
•
2 years ago
Plz run the code, it will be easier to explain that way.
I want red to be on the right sight, now it's on the left side.
How can i fix this?
(if it can be fixed multiple ways then i'm glad to know them).
I want red to be on the right sight, now it's on the left side.
How can i fix this?
(if it can be fixed multiple ways then i'm glad to know them).
- void setup() {
size(400, 400);
colorMode(HSB, 360, 100, 100);
}
void draw() {
background(204);
int H;
translate(width/2, height/2);
point(0,0);
float a = atan2(mouseY-height/2, mouseX-width/2);
rotate(a);
translate(100, 0);
H = int(map(a, -PI, PI, 0, 360));
fill(H, 100, 100);
rect(-12, -5, 24, 10);
}
1
