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.12 by greg, Wed Jun 15 12:52:19 1994 UTC vs.
Revision 2.13 by greg, Wed Jun 15 15:07:08 1994 UTC

# Line 564 | Line 564 | char   *v1, *v2, *v3;
564          char    *mod;
565          VNDX    v1i, v2i, v3i;
566          BARYCCM bvecs;
567 +        FVECT   bcoor[3];
568          int     texOK, patOK;
569 +        register int    i;
570  
571          if ((mod = getmtl()) == NULL)
572                  return(-1);
# Line 587 | Line 589 | char   *v1, *v2, *v3;
589                  printf("\n%s texfunc %s\n", mod, TEXNAME);
590                  mod = TEXNAME;
591                  printf("4 dx dy dz %s\n", TCALNAME);
592 <                printf("0\n16 ");
593 <                put_baryc(&bvecs);
594 <                printf("\t%14.12g %14.12g %14.12g\n",
595 <                                vnlist[v1i[2]][0], vnlist[v2i[2]][0],
596 <                                vnlist[v3i[2]][0]);
597 <                printf("\t%14.12g %14.12g %14.12g\n",
598 <                                vnlist[v1i[2]][1], vnlist[v2i[2]][1],
597 <                                vnlist[v3i[2]][1]);
598 <                printf("\t%14.12g %14.12g %14.12g\n",
599 <                                vnlist[v1i[2]][2], vnlist[v2i[2]][2],
600 <                                vnlist[v3i[2]][2]);
592 >                printf("0\n");
593 >                for (i = 0; i < 3; i++) {
594 >                        bcoor[i][0] = vnlist[v1i[2]][i];
595 >                        bcoor[i][1] = vnlist[v2i[2]][i];
596 >                        bcoor[i][2] = vnlist[v3i[2]][i];
597 >                }
598 >                put_baryc(&bvecs, bcoor, 3);
599          }
600   #ifdef TEXMAPS
601                                          /* put out pattern (if any) */
# Line 605 | Line 603 | char   *v1, *v2, *v3;
603                  printf("\n%s colorpict %s\n", mod, PATNAME);
604                  mod = PATNAME;
605                  printf("7 noneg noneg noneg %s %s u v\n", mapname, TCALNAME);
606 <                printf("0\n13 ");
607 <                put_baryc(&bvecs);
608 <                printf("\t%f %f %f\n", vtlist[v1i[1]][0],
609 <                                vtlist[v2i[1]][0], vtlist[v3i[1]][0]);
610 <                printf("\t%f %f %f\n", vtlist[v1i[1]][1],
611 <                                vtlist[v2i[1]][1], vtlist[v3i[1]][1]);
606 >                printf("0\n");
607 >                for (i = 0; i < 2; i++) {
608 >                        bcoor[i][0] = vtlist[v1i[1]][i];
609 >                        bcoor[i][1] = vtlist[v2i[1]][i];
610 >                        bcoor[i][2] = vtlist[v3i[1]][i];
611 >                }
612 >                put_baryc(&bvecs, bcoor, 2);
613          }
614   #endif
615                                          /* put out triangle */
# Line 671 | Line 670 | FLOAT  *v1, *v2, *v3;
670   }
671  
672  
673 < put_baryc(bcm)                          /* put barycentric coord. vectors */
673 > put_baryc(bcm, com, n)                  /* put barycentric coord. vectors */
674   register BARYCCM        *bcm;
675 + register FVECT  com[];
676 + int     n;
677   {
678 <        printf("\t%d\n", bcm->ax);
679 <        printf("%14.8f %14.8f %14.8f\n",
680 <                                bcm->tm[0][0], bcm->tm[0][1], bcm->tm[0][2]);
681 <        printf("%14.8f %14.8f %14.8f\n",
682 <                                bcm->tm[1][0], bcm->tm[1][1], bcm->tm[1][2]);
678 >        double  a, b;
679 >        register int    i, j;
680 >
681 >        printf("%d\t%d\n", 1+3*n, bcm->ax);
682 >        for (i = 0; i < n; i++) {
683 >                a = com[i][0] - com[i][2];
684 >                b = com[i][1] - com[i][2];
685 >                printf("%14.8f %14.8f %14.8f\n",
686 >                        bcm->tm[0][0]*a + bcm->tm[1][0]*b,
687 >                        bcm->tm[0][1]*a + bcm->tm[1][1]*b,
688 >                        bcm->tm[0][2]*a + bcm->tm[1][2]*b + com[i][2]);
689 >        }
690   }
691  
692  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines