problems with rotations

hi,

I am having a problem with a simple rotation problem.I have attached a rectangle to a coordinate axes such that one of its vertices align with the origin.I want to translate rectangle center to the origin and rotate the rectangle with respect to the current center.
In init() I translated rectangle’s center to origin.Now I need to rotate it in run(). what Ive done is
init()
{
translate(T);
scale(s);
rectangle();
}
in run()
{
gltranslate(-T)
rotate(x,1,0,0);
gltranslate(t);

}
The problem is the rectangle is always rotating wrt to the vertex but not the center of the rectangle.what is the problem with my code??Can someone help me please.

Thank you.

What happens if you leave out the translates in run() out? That will change the center of rotation.

glrotate(x,1,0,0);
gltranslate(t)
glscale(s);
rectangle();

Is this thing right??This thing dont work for me.I want to rotate the rectangle about its center.I also want to do the scale about the center.Thanks in advance.

I removed the translates out it doesnt work!! Its rotating with the vertex as center.

what should my matrix transforms order be??Otherwise Im just setting the matrix directly in run() what Ive to do,

SRT is not working??

Thank you very much.I did it.