Rotation around point other than origin

Now that I have my transformations applied to a vertex shader, I realized that no matter what translations have occurred, the rotation is always around the origin. Here is my rotation code (pulled from Matrix4f in lwjgl-util). Any ideas on why this rotation doesn’t rotate round translated coordinate would be appreciated.

// all matrix values are in the same order as Matrix4f.java from lwjgl
public Matrix rotate(float radians, float x, float y, float z) {
		Matrix src = this;
		float c = (float) Math.cos(radians);
		float s = (float) Math.sin(radians);
		float oneminusc = 1.0f - c;
		float xy = x*y;
		float yz = y*z;
		float xz = x*z;
		float xs = x*s;
		float ys = y*s;
		float zs = z*s;
		float f00 = x*x*oneminusc+c;
		float f01 = xy*oneminusc+zs;
		float f02 = xz*oneminusc-ys;
		// n[3] not used
		float f10 = xy*oneminusc-zs;
		float f11 = y*y*oneminusc+c;
		float f12 = yz*oneminusc+xs;
		// n[7] not used
		float f20 = xz*oneminusc+ys;
		float f21 = yz*oneminusc-xs;
		float f22 = z*z*oneminusc+c;
		float t00 = src.m00 * f00 + src.m10 * f01 + src.m20 * f02;
		float t01 = src.m01 * f00 + src.m11 * f01 + src.m21 * f02;
		float t02 = src.m02 * f00 + src.m12 * f01 + src.m22 * f02;
		float t03 = src.m03 * f00 + src.m13 * f01 + src.m23 * f02;
		float t10 = src.m00 * f10 + src.m10 * f11 + src.m20 * f12;
		float t11 = src.m01 * f10 + src.m11 * f11 + src.m21 * f12;
		float t12 = src.m02 * f10 + src.m12 * f11 + src.m22 * f12;
		float t13 = src.m03 * f10 + src.m13 * f11 + src.m23 * f12;
		m20 = src.m00 * f20 + src.m10 * f21 + src.m20 * f22;
		m21 = src.m01 * f20 + src.m11 * f21 + src.m21 * f22;
		m22 = src.m02 * f20 + src.m12 * f21 + src.m22 * f22;
		m23 = src.m03 * f20 + src.m13 * f21 + src.m23 * f22;
		m00 = t00;
		m01 = t01;
		m02 = t02;
		m03 = t03;
		m10 = t10;
		m11 = t11;
		m12 = t12;
		m13 = t13;
		return this;
	}

Any help would be appreciated,
CopyableCougar4

This comes up very often. Translate to the point then rotate then translate back

I am, but it still rotates around the origin.

This is how I rotate:

graphics.translate(new Vector((Application.getApplication().getWidth() / 2), 
				(Application.getApplication().getHeight() / 2), 0));
		graphics.rotate((float) Math.toDegrees(1), new Vector(0, 0, 1));
		graphics.translate(new Vector((Application.getApplication().getWidth() / 2), 
				(Application.getApplication().getHeight() / 2), 0).invert());

This is how i revert after rendering:

graphics.translate(new Vector((Application.getApplication().getWidth() / 2), 
				(Application.getApplication().getHeight() / 2), 0));
		graphics.rotate((float) Math.toDegrees(-1), new Vector(0, 0, 1));
		graphics.translate(new Vector((Application.getApplication().getWidth() / 2), 
				(Application.getApplication().getHeight() / 2), 0).invert());

But it doesn’t rotate around the given point.

I guess the issue is solved? It works not but I don’t really know why.

What do you mean?

Well now the rotation works just fine, but I didn’t change anything except the angle of rotation.

It’s in radians that could be the issue.

This is stated backwards. Translate the center of the rotation to the origin, rotate and then translate back to original: p’ = rot(p-c)+c.