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

Comparing ray/src/cv/obj2rad.c (file contents):
Revision 2.23 by greg, Fri Apr 23 16:20:56 2004 UTC vs.
Revision 2.24 by greg, Tue Jun 24 02:01:19 2008 UTC

# Line 35 | Line 35 | int    nvns;
35   RREAL   (*vtlist)[2];           /* map vertex list */
36   int     nvts;
37  
38 + int     ndegen = 0;             /* count of degenerate faces */
39 +
40   typedef int     VNDX[3];        /* vertex index (point,map,normal) */
41  
42   #define CHUNKSIZ        1024    /* vertex allocation chunk size */
# Line 140 | Line 142 | main(          /* read in .obj file and convert */
142                  printargs(argc, argv, stdout);
143                  convert(stdin);
144          }
145 +        if (ndegen)
146 +                printf("# %d degenerate faces\n", ndegen);
147          exit(0);
148   userr:
149          fprintf(stderr, "Usage: %s [-o obj][-m mapping][-n][-f] [file.obj]\n",
# Line 574 | Line 578 | putface(                               /* put out an N-sided polygon */
578                  return(1);
579          }
580          if ((cp = getmtl()) == NULL)
581 <                return(-1);
581 >                return(0);
582          printf("\n%s polygon %s.%d\n", cp, getonm(), faceno);
583          printf("0\n0\n%d\n", 3*ac);
584          for (i = 0; i < ac; i++) {
# Line 602 | Line 606 | puttri(                        /* put out a triangle */
606          register int    i;
607  
608          if ((mod = getmtl()) == NULL)
609 <                return(-1);
609 >                return(0);
610  
611          if (!cvtndx(v1i, v1) || !cvtndx(v2i, v2) || !cvtndx(v3i, v3))
612                  return(0);
# Line 615 | Line 619 | puttri(                        /* put out a triangle */
619  
620          switch (flatness) {
621          case DEGEN:                     /* zero area */
622 +                ndegen++;
623                  return(-1);
624          case RVFLAT:                    /* reversed normals, but flat */
625          case ISFLAT:                    /* smoothing unnecessary */
# Line 635 | Line 640 | puttri(                        /* put out a triangle */
640          if (texOK | patOK)
641                  if (comp_baryc(&bvecs, vlist[v1i[0]], vlist[v2i[0]],
642                                  vlist[v3i[0]]) < 0)
643 <                        return(-1);
643 >                        texOK = patOK = 0;
644                                          /* put out texture (if any) */
645          if (texOK) {
646                  printf("\n%s texfunc %s\n", mod, TEXNAME);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines