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

Comparing ray/src/cv/ies2rad.c (file contents):
Revision 2.15 by gregl, Fri Jul 25 11:18:18 1997 UTC vs.
Revision 2.16 by gregl, Fri Jul 25 12:08:06 1997 UTC

# Line 677 | Line 677 | char   *mod, *name;
677          else
678                  fprintf(out, "5 ");
679          fprintf(out, "%s %s source.cal ",
680 <                        sinf->type==SPHERE ? "corr" : "flatcorr",
680 >                        sinf->type==SPHERE ? "corr" :
681 >                        sinf->type==DISK ? "cylcorr" : "boxcorr",
682                          libname(buf,name,T_DST));
683          if (pmtype == PM_B) {
684                  if (FEQ(bounds[1][0],0.))
# Line 700 | Line 701 | char   *mod, *name;
701                  } else
702                          fprintf(out, "src_theta ");
703          }
704 <        fprintf(out, "\n0\n1 %g\n", sinf->mult);
704 >        if (sinf->type == SPHERE)
705 >                fprintf(out, "\n0\n1 %g\n", sinf->mult/sinf->area);
706 >        else if (sinf->type == DISK)
707 >                fprintf(out, "\n0\n3 %g %g %g\n", sinf->mult,
708 >                                sinf->l, sinf->h);
709 >        else
710 >                fprintf(out, "\n0\n4 %g %g %g %g\n", sinf->mult,
711 >                                sinf->l, sinf->w, sinf->h);
712          if (putsource(sinf, out, id, filename(name),
713                          bounds[0][0]<90., bounds[0][1]>90.) != 0)
714                  return(-1);
# Line 714 | Line 722 | FILE   *fp;
722   char    *mod, *name;
723   int     dolower, doupper;
724   {
725 <        int     dosides = 0;
726 <        char    buf[MAXWORD];
725 >        int     dosides = doupper && dolower && shp->h > MINDIM;
726 >        char    lname[MAXWORD];
727          
728 <        fprintf(fp, "\n%s %s %s_light\n", mod,
729 <                        shp->isillum ? "illum" : "light",
730 <                        name);
728 >        strcat(strcpy(lname, name), "_light");
729 >        fprintf(fp, "\n%s %s %s\n", mod,
730 >                        shp->isillum ? "illum" : "light", lname);
731          fprintf(fp, "0\n0\n3 %g %g %g\n",
732 <                        lampcolor[0]/shp->area,
725 <                        lampcolor[1]/shp->area,
726 <                        lampcolor[2]/shp->area);
727 <        if (doupper && dolower && shp->type != SPHERE && shp->h > MINDIM)
728 <                if (!shp->isillum) {
729 <                        fprintf(fp, "\n%s glow %s_glow\n", mod, name);
730 <                        fprintf(fp, "0\n0\n4 %g %g %g -1\n",
731 <                                        lampcolor[0]/shp->area,
732 <                                        lampcolor[1]/shp->area,
733 <                                        lampcolor[2]/shp->area);
734 <                        dosides++;
735 <                }
732 >                        lampcolor[0], lampcolor[1], lampcolor[2]);
733          switch (shp->type) {
734          case RECT:
738                strcat(strcpy(buf, name), "_light");
735                  if (dolower)
736 <                        putrectsrc(shp, fp, buf, name, 0);
736 >                        putrectsrc(shp, fp, lname, name, 0);
737                  if (doupper)
738 <                        putrectsrc(shp, fp, buf, name, 1);
739 <                if (dosides) {
740 <                        strcat(strcpy(buf, name), "_glow");
745 <                        putsides(shp, fp, buf, name);
746 <                }
738 >                        putrectsrc(shp, fp, lname, name, 1);
739 >                if (dosides)
740 >                        putsides(shp, fp, lname, name);
741                  break;
742          case DISK:
749                strcat(strcpy(buf, name), "_light");
743                  if (dolower)
744 <                        putdisksrc(shp, fp, buf, name, 0);
744 >                        putdisksrc(shp, fp, lname, name, 0);
745                  if (doupper)
746 <                        putdisksrc(shp, fp, buf, name, 1);
747 <                if (dosides) {
748 <                        strcat(strcpy(buf, name), "_glow");
756 <                        putcyl(shp, fp, buf, name);
757 <                }
746 >                        putdisksrc(shp, fp, lname, name, 1);
747 >                if (dosides)
748 >                        putcyl(shp, fp, lname, name);
749                  break;
750          case SPHERE:
751 <                strcat(strcpy(buf, name), "_light");
761 <                putspheresrc(shp, fp, buf, name);
751 >                putspheresrc(shp, fp, lname, name);
752                  break;
753          }
754          return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines