ok, i think i'm starting to understand what the problem is here. it seems that resetMatrix() is being called behind the scenes at every draw() loop. the following code executes as i would expect it:
Code:
rectMode(CENTER);
background(0);
framerate(1);
rect(0, 0, 10, 10);
translate(20, 20);
rect(0, 0, 10, 10);
translate(20,20);
rotate(radians(45));
rect(0, 0, 10, 10);
translate(20, 20);
rect(0, 0, 10, 10);
then i took the same code and broke it up into sections rendering each square in a seperate call to draw(). this is producing what looks like the same problem as my original post.
Code:
int f=-1;
void setup(){
rectMode(CENTER);
background(0);
framerate(1);
}
void draw(){
f++;
switch (f){
case 1:
rect(0, 0, 10, 10);
break;
case 2:
translate(20, 20);
rect(0, 0, 10, 10);
break;
case 3:
translate(20,20);
rotate(radians(45));
rect(0, 0, 10, 10);
break;
case 4:
translate(20, 20);
rect(0, 0, 10, 10);
break;
default:
f = 0;
}
}
so it's resetting each time and not remembering which way it was oriented. maybe i'm answering my own question here. looks like i need to store the matrix and recall it each loop - if that's even possible. anyone have some insight on what i'm trying to do here?