X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=visual%2Fvisual.c;h=29d9469863be3cde84069ef5444341091a37a0ea;hb=8358faac044f73487d64f5ba46690dd84367e532;hp=38ff0b0e09f321426d26ecc5c648fbf06e63c3c6;hpb=512390ceb93a2dd630943165b35bba683e0ffcfc;p=physik%2Fposic.git diff --git a/visual/visual.c b/visual/visual.c index 38ff0b0..29d9469 100644 --- a/visual/visual.c +++ b/visual/visual.c @@ -17,6 +17,29 @@ #include "../moldyn.h" #include "../math/math.h" +/* the pse, only needed here */ +static char *pse[]={ + "*", + "H", + "He", + "Li", + "Be", + "B", + "C", + "N", + "O", + "F", + "Ne", + "Na", + "Mg", + "Al", + "Si", + "P", + "S", + "Cl", + "Ar", +}; + int visual_init(t_visual *v,char *filebase) { char file[128+8]; @@ -30,6 +53,7 @@ int visual_init(t_visual *v,char *filebase) { perror("open visual fd"); return -1; } + dprintf(v->fd,"set write on\n"); memset(&(v->dim),0,sizeof(t_3dvec)); @@ -38,7 +62,10 @@ int visual_init(t_visual *v,char *filebase) { int visual_tini(t_visual *v) { - if(v->fd) close(v->fd); + if(v->fd) { + dprintf(v->fd,"quit\n"); + close(v->fd); + } return 0; } @@ -53,28 +80,6 @@ int visual_atoms(t_visual *v,double time,t_atom *atom,int n) { dim.y=10e9*v->dim.y; dim.z=10e9*v->dim.z; - char pse[19][4]={ - "*", - "H", - "He", - "Li", - "Be", - "B", - "C", - "N", - "O", - "F", - "Ne", - "Na", - "Mg", - "Al", - "Si", - "P", - "S", - "Cl", - "Ar", - }; - sprintf(file,"%s-%.15f.xyz",v->fb,time); fd=open(file,O_WRONLY|O_CREAT|O_TRUNC); if(fd<0) { @@ -84,7 +89,7 @@ int visual_atoms(t_visual *v,double time,t_atom *atom,int n) { /* script file update */ dprintf(v->fd,"load xyz %s\n",file); - dprintf(v->fd,"spacefill 300\n"); + dprintf(v->fd,"spacefill 270\n"); dprintf(v->fd,"rotate x 100\n"); dprintf(v->fd,"rotate y 10\n"); dprintf(v->fd,"set ambient 20\n");