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.7 by greg, Thu Apr 14 13:36:18 1994 UTC vs.
Revision 2.8 by greg, Tue Jun 14 14:30:38 1994 UTC

# Line 70 | Line 70 | RULEHD *ourmapping = NULL;
70   char    *defmat = DEFMAT;       /* default (starting) material name */
71   char    *defobj = DEFOBJ;       /* default (starting) object name */
72  
73 + int     flatten = 0;            /* discard surface normal information */
74 +
75   char    *getmtl(), *getonm();
76  
77   char    mapname[128];           /* current picture file */
# Line 99 | Line 101 | char   *argv[];
101                  case 'm':               /* use custom mapfile */
102                          ourmapping = getmapping(argv[++i], &qlist);
103                          break;
104 +                case 'f':               /* flatten surfaces */
105 +                        flatten++;
106 +                        break;
107                  default:
108                          goto userr;
109                  }
# Line 572 | Line 577 | char   *v1, *v2, *v3;
577          if (!cvtndx(v1i, v1) || !cvtndx(v2i, v2) || !cvtndx(v3i, v3))
578                  return(0);
579                                          /* compute barycentric coordinates */
580 <        texOK = (v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0);
580 >        texOK = !flatten && (v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0);
581   #ifdef TEXMAPS
582          patOK = mapname[0] && (v1i[1]>=0 && v2i[1]>=0 && v3i[1]>=0);
583   #else
# Line 792 | Line 797 | register VNDX  p0i, p1i, p2i, p3i;
797   #ifdef TEXMAPS
798          /* also check for texture indices */
799   #endif
800 <        if (!(p0i[2]>=0 && p1i[2]>=0 && p2i[2]>=0 && p3i[2]>=0))
800 >        if (flatten || !(p0i[2]>=0 && p1i[2]>=0 && p2i[2]>=0 && p3i[2]>=0))
801                  return(-1);
802                                          /* find dominant axis */
803          VCOPY(v1, vnlist[p0i[2]]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines