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.4 by greg, Tue Dec 5 10:59:27 1995 UTC vs.
Revision 1.7 by gregl, Thu May 22 08:41:04 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"
24  
25   #define O_INV1          1       /* Inventor 1.0 output */
26   #define O_INV2          2       /* Inventor 2.0 output */
27 < #define O_VRML          3       /* VRML output */
27 > #define O_VRML1         3       /* VRML 1.0 output */
28  
29   #define MAXID           48      /* maximum identifier length */
30  
# Line 97 | Line 99 | char   *argv[];
99                                  /* get options and print format line */
100          for (i = 1; i < argc && argv[i][0] == '-'; i++)
101                  if (!strcmp(argv[i], "-vrml"))
102 <                        outtype = O_VRML;
102 >                        outtype = O_VRML1;
103                  else if (!strcmp(argv[i], "-1"))
104                          outtype = O_INV1;
105                  else if (!strcmp(argv[i], "-2"))
# Line 111 | Line 113 | char   *argv[];
113          case O_INV2:
114                  printf("#Inventor V2.0 ascii\n");
115                  break;
116 <        case O_VRML:
117 <                printf("#VRML 1.0 ascii\n");
116 >        case O_VRML1:
117 >                printf("#VRML V1.0 ascii\n");
118                  break;
119          }
120          printf("## Translated from MGF Version %d.%d\n", MG_VMAJOR, MG_VMINOR);
# 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