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.15 by greg, Wed Jun 22 12:35:59 1994 UTC vs.
Revision 2.16 by greg, Wed Jul 24 13:07:41 1996 UTC

# Line 568 | Line 568 | char   *v1, *v2, *v3;
568          if (!cvtndx(v1i, v1) || !cvtndx(v2i, v2) || !cvtndx(v3i, v3))
569                  return(0);
570                                          /* compute barycentric coordinates */
571 <        texOK = !flatten && (v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0);
571 >        if (!flatten && v1i[2]>=0 && v2i[2]>=0 && v3i[2]>=0)
572 >                switch (flat_tri(vlist[v1i[0]], vlist[v2i[0]], vlist[v3i[0]],
573 >                        vnlist[v1i[2]], vnlist[v2i[2]], vnlist[v3i[2]])) {
574 >                case DEGEN:             /* zero area */
575 >                        return(-1);
576 >                case RVFLAT:            /* reversed normals, but flat */
577 >                case ISFLAT:            /* smoothing unnecessary */
578 >                        texOK = 0;
579 >                        break;
580 >                case RVBENT:            /* reversed normals with smoothing */
581 >                case ISBENT:            /* proper smoothing */
582 >                        texOK = 1;
583 >                        break;
584 >                }
585 >        else
586 >                texOK = 0;
587   #ifdef TEXMAPS
588          patOK = mapname[0] && (v1i[1]>=0 && v2i[1]>=0 && v3i[1]>=0);
589   #else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines