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

Comparing ray/src/cv/mgflib/parser.c (file contents):
Revision 1.4 by greg, Fri Jun 24 09:32:51 1994 UTC vs.
Revision 1.5 by greg, Fri Jun 24 09:40:29 1994 UTC

# Line 904 | Line 904 | char   **av;
904  
905          if (ac < 5)
906                  return(MG_EARGC);
907 <        if (!isflt(av[1]))
907 >        if (!isflt(av[ac-1]))
908                  return(MG_ETYPE);
909 <        length = atof(av[1]);
909 >        length = atof(av[ac-1]);
910          if (length <= FTINY && length >= -FTINY)
911                  return(MG_EILL);
912                                          /* do bottom face */
913          newav[0] = mg_ename[MG_E_FACE];
914          for (i = 1; i < ac-1; i++)
915 <                newav[i] = av[i+1];
915 >                newav[i] = av[i];
916          newav[i] = NULL;
917          if ((rv = handle_it(MG_E_FACE, i, newav)) != MG_OK)
918                  return(rv);
# Line 922 | Line 922 | char   **av;
922          norm[0] = norm[1] = norm[2] = 0.;
923          v1[0] = v1[1] = v1[2] = 0.;
924          for (i = 2; i < ac-1; i++) {
925 <                if ((cv = c_getvert(av[i+1])) == NULL)
925 >                if ((cv = c_getvert(av[i])) == NULL)
926                          return(MG_EUNDEF);
927                  v2[0] = cv->p[0] - cv0->p[0];
928                  v2[1] = cv->p[1] - cv0->p[1];
# Line 941 | Line 941 | char   **av;
941                  vent[1] = nvn[i-1];
942                  if ((rv = handle_it(MG_E_VERTEX, 3, vent)) != MG_OK)
943                          return(rv);
944 <                cv = c_getvert(av[i+1]);        /* checked above */
944 >                cv = c_getvert(av[i]);          /* checked above */
945                  for (j = 0; j < 3; j++)
946                          sprintf(p[j], FLTFMT, cv->p[j] - length*norm[j]);
947                  if ((rv = handle_it(MG_E_POINT, 4, pent)) != MG_OK)
# Line 953 | Line 953 | char   **av;
953                  return(rv);
954                                                  /* do the side faces */
955          newav[5] = NULL;
956 <        newav[3] = av[ac-1];
956 >        newav[3] = av[ac-2];
957          newav[4] = nvn[ac-3];
958          for (i = 1; i < ac-1; i++) {
959                  newav[1] = nvn[i-1];
960 <                newav[2] = av[i+1];
960 >                newav[2] = av[i];
961                  if ((rv = handle_it(MG_E_FACE, 5, newav)) != MG_OK)
962                          return(rv);
963                  newav[3] = newav[2];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines