draw does not refresh screen
in
Programming Questions
•
1 year ago
Hello,
i'm new to processing and i have written some code which does not work properly (i want that blue and that green (i do not know how do you call them) to rotate like they have to..):
- PImage bg, z, m;
float i=0;
void setup()
{
size(700, 447);
smooth();
noStroke();
fill(255);
frameRate(30);
bg = loadImage("gd.png");
m = loadImage("melynas.png");
z = loadImage("zalias.png");
}
void draw()
{
background(bg);
i = i + 1;
translate(301, 133);
rotate(radians(i));
translate(-m.width/2, -m.height/2);
image(m, 0, 0);
resetMatrix();
translate(192, 256.5);
rotate(radians(-i));
translate(-z.width/2, -z.height/2);
image(z, 0, 0);
}
And the problem is that my rotating images draw's on themselfs. If i draw a rectangle and set it to this kind of rotation - it rotates on himself and becomes a circle...
A print screen of what i'm talking about:
with noLoop():
And with the code that i have posted:
1