- /* print out positions in rasmol format */
- dprintf(fd,"%d\nTime %f\n",amount_si,time);
+ /* rasmol script & xyz file */
+ sprintf(xyz,"./saves/si-%.15f.xyz",time);
+ sprintf(scr,"./saves/si-%.15f.scr",time);
+ sprintf(ppm,"./video/si-%.15f.ppm",time);
+ fd1=open(xyz,O_WRONLY|O_CREAT|O_TRUNC);
+ fd2=open(scr,O_WRONLY|O_CREAT|O_TRUNC);
+ if((fd1<0)||(fd2<0)) {
+ perror("rasmol file open");
+ return -1;
+ }
+ dprintf(fd2,"load xyz %s\n",xyz);
+ dprintf(fd2,"spacefill 200\n");
+ dprintf(fd2,"rotate x 11\n");
+ dprintf(fd2,"rotate y 13\n");
+ dprintf(fd2,"set ambient 20\n");
+ dprintf(fd2,"set specular on\n");
+ dprintf(fd2,"set write on\n");
+ dprintf(fd2,"write ppm %s\n",ppm);
+ dprintf(fd1,"%d\nsilicon\n",amount_si);