Rotate a cube around its axis?

I want to rotate a cube so that it doesn’t float around the camera, instead stays in exactly the same apparent location but a different one of its faces points towards the camera. I tried to glTranslate directly into the center of the cube and then doing a glRotate before drawing it, but that doesn’t work, it still seems to rotate around a random point is space a certain distance away from it.

How can I do this? I’m thinking of using JME, can it do that sort of thing for me?

Remember when you are concatenating transformation matrices, you must multiply them in the reverse of the desired order of operation. The problem you are seeing is because rotations are performed around the origin.

So in short, try rotating and then translating.