--- ray/src/cv/rad2mgf.c 1994/07/09 09:42:48 2.4 +++ ray/src/cv/rad2mgf.c 1994/12/07 12:44:05 2.7 @@ -15,6 +15,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include "color.h" #include "lookup.h" +#define PI 3.14159265358979323846 + int o_face(), o_cone(), o_sphere(), o_ring(), o_cylinder(); int o_instance(), o_source(), o_illum(); int o_plastic(), o_metal(), o_glass(), o_mirror(), o_trans(), o_light(); @@ -80,6 +82,8 @@ char **argv; goto unkopt; } break; + default: + goto unkopt; } init(); if (i >= argc) @@ -306,6 +310,17 @@ uninit() /* mark end of MGF file */ } +clrverts() /* clear vertex table */ +{ + register int i; + + lu_done(&vertab); + for (i = 0; i < NVERTS; i++) + vert[i].lused = 0; + lu_init(&vertab, NVERTS); +} + + add2dispatch(name, func) /* add function to dispatch table */ char *name; int (*func)(); @@ -511,6 +526,7 @@ FUNARGS *fa; fputs(fa->sarg[i], stdout); } putchar('\n'); + clrverts(); /* vertex id's no longer reliable */ return(0); } @@ -714,6 +730,6 @@ register FUNARGS *fa; puts("\tc"); if (d > FTINY) printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); - printf("\ted %.4g\n", cxyz[1]*WHTEFFICACY); + printf("\ted %.4g\n", cxyz[1]*(PI*WHTEFFICACY)); return(0); }