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

Comparing ray/src/cv/pabopto2bsdf.c (file contents):
Revision 2.6 by greg, Sat Oct 19 00:11:50 2013 UTC vs.
Revision 2.7 by greg, Mon Oct 21 18:33:15 2013 UTC

# Line 216 | Line 216 | main(int argc, char *argv[])
216          make_rbfrep();
217                                                  /* produce spheres at meas. */
218          puts("void plastic yellow\n0\n0\n5 .6 .4 .01 .04 .08\n");
219        puts("void plastic pink\n0\n0\n5 .5 .05 .9 .04 .08\n");
219          min_log = log(bsdf_min*.5);
220          n = 0;
221          for (i = 0; i < GRIDRES; i++)
222              for (j = 0; j < GRIDRES; j++)
223 <                if (dsf_grid[i][j].vsum > .0f) {
223 >                if (dsf_grid[i][j].nval > 0) {
224                          ovec_from_pos(dir, i, j);
225 <                        bsdf = dsf_grid[i][j].vsum / dir[2];
225 >                        bsdf = dsf_grid[i][j].vsum/(dsf_grid[i][j].nval*dir[2]);
226                          if (bsdf <= bsdf_min*.6)
227                                  continue;
228                          bsdf = log(bsdf) - min_log;
229 <                        if (dsf_grid[i][j].nval) {
230 <                                printf("pink cone c%04d\n0\n0\n8\n", ++n);
231 <                                printf("\t%.6g %.6g %.6g\n",
233 <                                        dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf);
234 <                                printf("\t%.6g %.6g %.6g\n",
235 <                                        dir[0]*bsdf*1.02, dir[1]*bsdf*1.02,
236 <                                        dir[2]*bsdf*1.02);
237 <                                printf("\t%.6g\t0\n", .02*bsdf);
238 <                        } else {
239 <                                ovec_from_pos(dir, i, j);
240 <                                printf("yellow sphere s%04d\n0\n0\n", ++n);
241 <                                printf("4 %.6g %.6g %.6g %.6g\n\n",
229 >                        ovec_from_pos(dir, i, j);
230 >                        printf("yellow sphere s%04d\n0\n0\n", ++n);
231 >                        printf("4 %.6g %.6g %.6g %.6g\n\n",
232                                          dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf,
233 <                                        .01*bsdf);
244 <                        }
233 >                                        .007*bsdf);
234                  }
235                                                  /* output continuous surface */
236          puts("void trans tgreen\n0\n0\n7 .7 1 .7 .04 .04 .9 1\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines