OK, I just cant get this to work
The camera turns around in the wrong direction and then turns upside down.
Here is my code:
public void lookAt(Vector3f eye, Vector3f target, Vector3f up) {
Vector3f forward = new Vector3f(0, 0, 0);
Vector3f.sub(target, eye, forward);
forward.normalise();
Vector3f side = new Vector3f(0, 0, 0);
Vector3f.cross(forward, up, side);
side.normalise();
Vector3f.cross(side, forward, up);
Matrix4f mat = new Matrix4f();
mat.setIdentity();
mat.m00 = side.x;
mat.m01 = side.y;
mat.m02 = side.z;
mat.m10 = up.x;
mat.m11 = up.y;
mat.m12 = up.z;
mat.m20 = -forward.x;
mat.m21 = -forward.y;
mat.m22 = -forward.z;
Vector3f forward2 = new Vector3f(forward.x, 0, forward.z);
forward2.normalise();
float yawChange = (float) Math.atan2(forward2.z, forward2.x);
float pitchChange = (float) Math.acos(Vector3f.dot(forward, forward2));
yaw += yawChange;
pitch += pitchChange;
}
For the eye parameter, I give it the camera position. For the target, I give it the player position. For up, I give it a new Vector3f(0, 1, 0).
Can you see anything wrong? Also, Sorry if this is a sort of dumb question 
Thanks.