You're code does not respect that camera's tilt. Here is an easy way to do it:

Code:
vec_set(temp,vector(512,0,0));
vec_rotate(temp,camera.pan);
vec_add(temp,camera.x);
ent_create(SPHERE_MDL,temp,NULL);



Always learn from history, to be sure you make the same mistakes again...