home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "rtd.h"
- #include "extern.h"
-
- char * mlalloc();
-
- g_bal (df)
- FILE * df;
- {
- int i;
- double x,
- y,
- z,
- r,
- ior,
- rfr,
- rfl,
- dif,
- amb;
- struct ball *bp;
-
- for (i = 0;
- fscanf (df, "%lf %lf %lf %lf %lf %lf %lf %lf %lf",
- &x, &y, &z, &r, &ior, &rfr, &rfl, &dif, &amb) != EOF;
- i++) {
- bl[i] = (struct ball *) mlalloc ((long) sizeof (struct ball));
- if (bl[i] == NULL) booboo("Out of memory.");
- bp = bl[i];
- bp -> s.cent.x = x;
- bl[i] -> s.cent.y = y;
- bl[i] -> s.cent.z = z;
- bl[i] -> s.rad = r;
- bl[i] -> ior = ior;
- bl[i] -> rfr = rfr;
- bl[i] -> rfl = rfl;
- bl[i] -> dif = dif;
- bl[i] -> amb = amb;
- }
- return (i);
- }
-