I'm trying to rotate an arrow texture by an arbitrary number of degrees, and draw it at some coordinates. The rotation should happen around the corner, while it should be drawn using the top left corner coordinates:
void ofApp::drawArrow(const ofTexture &arrow, int degrees, int x, int y){
ofPushMatrix();
ofSetRectMode(OF_RECTMODE_CENTER);
ofTranslate(x,y);
ofRotateZ(degrees);
arrow.draw(0,0);
ofPopMatrix();
}
If I do it like this, the arrows will be correctly rotated and drawn where I want them to be. Unfortunately, all other draw() commands will be affected by the new RectMode as well, although it's used after pushing a new matrix on the stack.
If I add an ofSetRectMode(OF_RECTMODE_CORNER) in the end before popping off the matrix, the arrow texture won't be rotated around the centre, but the edge, despite the order of commands.
I'm using a recent (about 3 weeks old) nightly built. What am I doing wrong? Thank you so much.