Code:
vec_set (camera.pan,my.pan);
vec_set (camera.x,vector(-500,0,0));
vec_rotate (camera.x,camera.pan);
vec_add (camera.x,my.x);



the 2nd line gives the "offset" relative to the entity.