Rotating a quad that isn't at the center of the grid..

First of all, sorry to make another post here so soon, I’m still new to this and I couldn’t figure this out after at least 20 minutes of Googling.

So, I’m trying to rotate a quad that isn’t at the center of a coordinate grid, like the title said.

This is what I initially tried:

public void render(){
		int renderX = ot.getValue("fieldX") + (BattleRoom.FIELD_WIDTH * fieldX);
		int renderY = ot.getValue("fieldY") + (BattleRoom.FIELD_HEIGHT * fieldY);
		FloatBuffer matrix = BufferUtils.createFloatBuffer(16);
		glGetFloat(GL_MODELVIEW_MATRIX, matrix);
		
		glPushMatrix();
		//glTranslatef(renderX,renderY,0);
		//glRotatef(5, 0, 1, 0);
		glTranslatef(matrix.get(15), matrix.get(14), 0);
		glColor3f(1,1,1);
		currentAnim.render(renderX, renderY - 40);
		glPopMatrix();
	}

Basically I was getting the matrix values and placing them in a float buffer, and then pushing the matrix. I would then translate the grid so that the center was at the player, and then rotate, and move it back to its original position,draw him, and pop the matrix to ensure the rotation doesn’t stick around. Unfortunately, the player is still nowhere to be found. In my debugging I noticed that if the commands that are noted out aren’t there, the player draws correctly. So at least my matrix to float buffer idea worked ^-^

Anyway, what should I do?

glTranslate(-cube.pos);
glRotate(your angle, your axis);
glTranslate(cube.pos);

That didn’t solve my problem, unfortunately. Thanks anyway, though!

You don’t need the matrix at all. What CyanPrime said was correct and should be the only code in that method.

I can see where translating to a negative of where he was, and then rotating would work, but centering the translation back at where he is isn’t, because it was never centered around him to begin with.

I only reference the old matrix so that I can recenter it at where it once was, so I can draw the player correctly in his place.

I mean, if this were built differently, I could see it working, but mine is really weird…