X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=visual%2Fvisual.c;h=7b7862e02bf15d0a06e4dd5158d489d43b90d26f;hb=b040d775deb32173e6536464a3e2ad95a6a5bd55;hp=6ad527a8ee4100bc58a5e91e4dce746cf7fea942;hpb=710717c4033bc5b8eb34644914e762a2834ae345;p=physik%2Fposic.git diff --git a/visual/visual.c b/visual/visual.c index 6ad527a..7b7862e 100644 --- a/visual/visual.c +++ b/visual/visual.c @@ -25,7 +25,7 @@ int visual_init(t_visual *v,char *filebase) { memset(file,0,128+8); sprintf(file,"%s.scr",v->fb); - v->fd=open(file,O_WRONLY); + v->fd=open(file,O_WRONLY|O_CREAT|O_TRUNC); if(v->fd<0) { perror("open visual fd"); return -1; @@ -69,7 +69,7 @@ int visual_atoms(t_visual *v,double time,t_atom *atom,int n) { }; sprintf(file,"%s-%.15f.xyz",v->fb,time); - fd=open(file,O_WRONLY); + fd=open(file,O_WRONLY|O_CREAT|O_TRUNC); if(fd<0) { perror("open visual save file fd"); return -1; @@ -78,8 +78,8 @@ 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 200\n"); - dprintf(v->fd,"rotate x 11\n"); - dprintf(v->fd,"rotate y 13\n"); + dprintf(v->fd,"rotate x 100\n"); + dprintf(v->fd,"rotate y 10\n"); dprintf(v->fd,"set ambient 20\n"); dprintf(v->fd,"set specular on\n"); sprintf(file,"%s-%.15f.ppm",v->fb,time); @@ -87,8 +87,8 @@ int visual_atoms(t_visual *v,double time,t_atom *atom,int n) { dprintf(v->fd,"zap\n"); /* write the actual data file */ - dprintf(fd,"Atoms at time %.15f\n",time); dprintf(fd,"%d\n",n); + dprintf(fd,"atoms at time %.15f\n",time); for(i=0;i