flip ofRect with ofRotateY

I can’t seem to get an ofRect to rotate in place in 3D space. It always looks wobbly, as if the entire rectangle is being rotated around something, rather than it be flipped in place. I’ve looked at the following posts but they didn’t help:
http://forum.openframeworks.cc/t/glrotate-a-rectangle-in-place/4813/0
http://forum.openframeworks.cc/t/how-to-rotate-around-center-of-mass/3942/0
http://forum.openframeworks.cc/t/glrotatef-and-transformations/8966/0

Here’s my sample code:
[pre]
cam.begin();

angle++;
if (angle >360) angle = 0;

ofSetRectMode(OF_RECTMODE_CENTER);
ofPushMatrix();
ofRotateY(angle);
ofRect(0,0,500,500);
ofPopMatrix();

cam.end();
[/pre]

You might need to throw in an ofTranslate in before your rotate to move the transform space over. i haven’t quite figured out the OF rotation matrix stuff…the rotates generally need an offset because i think they rotating around 0 by default?

Try this:

  
  
  
void testApp::setup(){  
    ofSetVerticalSync(true); // this is important to keep things from looking weird at the edges  
}  
  
void testApp::draw(){  
    ofClear(0, 0, 0);  
      
    cam.begin();  
      
    angle+=0.5;  
  
    ofPushMatrix();     
    ofTranslate(0, -200); // go to center  
    ofRotateY(angle);  
    ofTranslate(-250, 0); // rotate from center of rect  
    ofRect(0,0,500,500);  
    ofPopMatrix();  
      
    cam.end();  
}