ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/mgflib/mgf2inv.c
(Generate patch)

Comparing ray/src/cv/mgflib/mgf2inv.c (file contents):
Revision 1.3 by greg, Tue Dec 5 10:34:12 1995 UTC vs.
Revision 1.6 by greg, Tue Mar 18 11:05:43 1997 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include <ctype.h>
18  
19 + #include <string.h>
20 +
21   #include "parser.h"
22  
23   #include "lookup.h"
# Line 338 | Line 340 | put_material()                 /* put out current material */
340                  mgf2rgb(&c_cmaterial->rs_c, c_cmaterial->rs, rgbval);
341                  printf("%sspecularColor %.4f %.4f %.4f\n", tabs,
342                                  rgbval[0], rgbval[1], rgbval[2]);
343 <                printf("%sshininess %.3f\n", tabs, 1.-c_cmaterial->rs_a);
343 >                printf("%sshininess %.3f\n", tabs, 1.-sqrt(c_cmaterial->rs_a));
344          }
345          if (c_cmaterial->ed > FTINY) {
346                  mgf2rgb(&c_cmaterial->ed_c, 1.0, rgbval);
# Line 468 | Line 470 | char   **av;
470          va[1] = v2->p[1] - v1->p[1];
471          va[2] = v2->p[2] - v1->p[2];
472          length = sqrt(DOT(va,va));
473 <        angle = acos(va[1]/length);
473 >        if (va[1] >= length)
474 >                angle = 0.;
475 >        else if (va[1] <= -length)
476 >                angle = PI;
477 >        else
478 >                angle = acos(va[1]/length);
479          printf("%sTranslation { translation %13.9g %13.9g %13.9g }\n", tabs,
480                          .5*(v1->p[0]+v2->p[0]), .5*(v1->p[1]+v2->p[1]),
481                          .5*(v1->p[2]+v2->p[2]));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines