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

Comparing ray/src/cv/bsdf2rad.c (file contents):
Revision 2.19 by greg, Mon Apr 10 01:31:37 2017 UTC vs.
Revision 2.20 by greg, Mon Apr 10 06:09:14 2017 UTC

# Line 26 | Line 26 | double overall_max = .0;               /* overall maximum BSDF valu
26  
27   char    ourTempDir[TEMPLEN] = "";       /* our temporary directory */
28  
29 const FVECT     Xaxis = {1., 0., 0.};
29   const FVECT     Yaxis = {0., 1., 0.};
31 const FVECT     Zaxis = {0., 0., 1.};
30  
31   const char      frpref[] = "frefl";
32   const char      ftpref[] = "ftrans";
# Line 68 | Line 66 | get_ivector(FVECT iv, int i)
66   static RREAL *
67   cvt_sposition(FVECT sp, const FVECT iv, int inc_side)
68   {
69 <        sp[0] = -iv[0]*sph_rad - inc_side*sph_xoffset;
69 >        sp[0] = -iv[0]*sph_rad + inc_side*sph_xoffset;
70          sp[1] = -iv[1]*sph_rad;
71          sp[2] = iv[2]*sph_rad;
72  
# Line 387 | Line 385 | put_BSDFs(void)
385                          NINCIDENT);
386  
387          printf("\nvoid glow arrow_glow\n0\n0\n4 1 0 1 0\n");
388 <        printf("\nvoid mixfunc arrow_mat\n4 arrow_glow void .5 .\n0\n0\n");
388 >        printf("\nvoid mixfunc arrow_mat\n4 arrow_glow void 0.5 .\n0\n0\n");
389  
390          if (front_comp & SDsampR)                       /* front reflection */
391                  for (i = 0; i < NINCIDENT; i++) {
# Line 409 | Line 407 | put_BSDFs(void)
407                          nxfa += 6;
408                          fname = tfile_name(frpref, dsuffix, i);
409                          sprintf(cmdbuf, "gensurf scale_mat %s%d %s %s %s %d %d | xform %s",
410 <                                        frpref, i+1, fname, fname, fname, SAMPRES-1, SAMPRES-1,
410 >                                        frpref, i, fname, fname, fname, SAMPRES-1, SAMPRES-1,
411                                          xfargs);
412                          if (!run_cmd(cmdbuf))
413                                  return(0);
# Line 434 | Line 432 | put_BSDFs(void)
432                          nxfa += 6;
433                          fname = tfile_name(ftpref, dsuffix, i);
434                          sprintf(cmdbuf, "gensurf scale_mat %s%d %s %s %s %d %d | xform -I %s",
435 <                                        ftpref, i+1, fname, fname, fname, SAMPRES-1, SAMPRES-1,
435 >                                        ftpref, i, fname, fname, fname, SAMPRES-1, SAMPRES-1,
436                                          xfargs);
437                          if (!run_cmd(cmdbuf))
438                                  return(0);
# Line 459 | Line 457 | put_BSDFs(void)
457                          nxfa += 6;
458                          fname = tfile_name(brpref, dsuffix, i);
459                          sprintf(cmdbuf, "gensurf scale_mat %s%d %s %s %s %d %d | xform -I -ry 180 %s",
460 <                                        brpref, i+1, fname, fname, fname, SAMPRES-1, SAMPRES-1,
460 >                                        brpref, i, fname, fname, fname, SAMPRES-1, SAMPRES-1,
461                                          xfargs);
462                          if (!run_cmd(cmdbuf))
463                                  return(0);
# Line 484 | Line 482 | put_BSDFs(void)
482                          nxfa += 6;
483                          fname = tfile_name(btpref, dsuffix, i);
484                          sprintf(cmdbuf, "gensurf scale_mat %s%d %s %s %s %d %d | xform -ry 180 %s",
485 <                                        btpref, i+1, fname, fname, fname, SAMPRES-1, SAMPRES-1,
485 >                                        btpref, i, fname, fname, fname, SAMPRES-1, SAMPRES-1,
486                                          xfargs);
487                          if (!run_cmd(cmdbuf))
488                                  return(0);
# Line 502 | Line 500 | put_matBSDF(const char *XMLfile)
500                  printf("\n# Simplified material because we have no XML input\n");
501                  printf("\nvoid brightfunc latlong\n2 latlong bsdf2rad.cal\n0\n0\n");
502                  if ((front_comp|back_comp) & SDsampT)
503 <                        printf("\nlatlong trans %s\n0\n0\n7 .75 .75 .75 0 0 .5 .8\n",
503 >                        printf("\nlatlong trans %s\n0\n0\n7 .75 .75 .75 0 .04 .5 .8\n",
504                                          sph_mat);
505                  else
506                          printf("\nlatlong plastic %s\n0\n0\n5 .5 .5 .5 0 0\n",
# Line 532 | Line 530 | static void
530   put_source(void)
531   {
532          printf("\n# Overhead parallel light source\n");
533 <        printf("\nvoid light bright\n0\n0\n3 2000 2000 2000\n");
533 >        printf("\nvoid light bright\n0\n0\n3 2500 2500 2500\n");
534          printf("\nbright source light\n0\n0\n4 0 0 1 2\n");
535          printf("\n# Material used for labels\n");
536          printf("\nvoid trans vellum\n0\n0\n7 1 1 1 0 0 .5 0\n");
# Line 546 | Line 544 | put_hemispheres(void)
544          printf("\nvoid antimatter anti_sph\n2 void %s\n0\n0\n", sph_mat);
545          if (front_comp) {
546                  printf("\n%s sphere Front\n0\n0\n4 %f 0 0 %f\n",
547 <                                sph_mat, -sph_xoffset, sph_rad);
547 >                                sph_mat, sph_xoffset, sph_rad);
548                  printf("\n!genbox anti_sph sph_eraser %f %f %f | xform -t %f %f %f\n",
549                                  2.02*sph_rad, 2.02*sph_rad, 1.02*sph_rad,
550 <                                -1.01*sph_rad - sph_xoffset, -1.01*sph_rad, -1.01*sph_rad);
550 >                                -1.01*sph_rad + sph_xoffset, -1.01*sph_rad, -1.01*sph_rad);
551                  printf("\nvoid brighttext front_text\n3 helvet.fnt . FRONT\n0\n");
552                  printf("12\n\t%f %f 0\n\t%f 0 0\n\t0 %f 0\n\t.01 1 -.1\n",
553 <                                -.22*sph_rad - sph_xoffset, -1.4*sph_rad,
553 >                                -.22*sph_rad + sph_xoffset, -1.4*sph_rad,
554                                  .35/5.*sph_rad, -1.6*.35/5.*sph_rad);
555                  printf("\nfront_text alias front_label_mat vellum\n");
556                  printf("\nfront_label_mat polygon front_label\n0\n0\n12");
557                  printf("\n\t%f %f 0\n\t%f %f 0\n\t%f %f 0\n\t%f %f 0\n",
558 <                                -.25*sph_rad - sph_xoffset, -1.3*sph_rad,
559 <                                -.25*sph_rad - sph_xoffset, (-1.4-1.6*.35/5.-.1)*sph_rad,
560 <                                .25*sph_rad - sph_xoffset, (-1.4-1.6*.35/5.-.1)*sph_rad,
561 <                                .25*sph_rad - sph_xoffset, -1.3*sph_rad );
558 >                                -.25*sph_rad + sph_xoffset, -1.3*sph_rad,
559 >                                -.25*sph_rad + sph_xoffset, (-1.4-1.6*.35/5.-.1)*sph_rad,
560 >                                .25*sph_rad + sph_xoffset, (-1.4-1.6*.35/5.-.1)*sph_rad,
561 >                                .25*sph_rad + sph_xoffset, -1.3*sph_rad );
562          }
563          if (back_comp) {
564                  printf("\n%s bubble Back\n0\n0\n4 %f 0 0 %f\n",
565 <                                sph_mat, sph_xoffset, sph_rad);
565 >                                sph_mat, -sph_xoffset, sph_rad);
566                  printf("\n!genbox anti_sph sph_eraser %f %f %f | xform -t %f %f %f\n",
567                                  2.02*sph_rad, 2.02*sph_rad, 1.02*sph_rad,
568 <                                -1.01*sph_rad + sph_xoffset, -1.01*sph_rad, -1.01*sph_rad);
568 >                                -1.01*sph_rad - sph_xoffset, -1.01*sph_rad, -1.01*sph_rad);
569                  printf("\nvoid brighttext back_text\n3 helvet.fnt . BACK\n0\n");
570                  printf("12\n\t%f %f 0\n\t%f 0 0\n\t0 %f 0\n\t.01 1 -.1\n",
571 <                                -.22*sph_rad + sph_xoffset, -1.4*sph_rad,
571 >                                -.22*sph_rad - sph_xoffset, -1.4*sph_rad,
572                                  .35/4.*sph_rad, -1.6*.35/4.*sph_rad);
573                  printf("\nback_text alias back_label_mat vellum\n");
574                  printf("\nback_label_mat polygon back_label\n0\n0\n12");
575                  printf("\n\t%f %f 0\n\t%f %f 0\n\t%f %f 0\n\t%f %f 0\n",
576 <                                -.25*sph_rad + sph_xoffset, -1.3*sph_rad,
577 <                                -.25*sph_rad + sph_xoffset, (-1.4-1.6*.35/4.-.1)*sph_rad,
578 <                                .25*sph_rad + sph_xoffset, (-1.4-1.6*.35/4.-.1)*sph_rad,
579 <                                .25*sph_rad + sph_xoffset, -1.3*sph_rad );
576 >                                -.25*sph_rad - sph_xoffset, -1.3*sph_rad,
577 >                                -.25*sph_rad - sph_xoffset, (-1.4-1.6*.35/4.-.1)*sph_rad,
578 >                                .25*sph_rad - sph_xoffset, (-1.4-1.6*.35/4.-.1)*sph_rad,
579 >                                .25*sph_rad - sph_xoffset, -1.3*sph_rad );
580          }
581   }
582  
# Line 587 | Line 585 | static void
585   put_scale(void)
586   {
587          const double    max_log10 = log10(overall_max);
588 <        const double    leg_width = 2.*.75*(sph_xoffset - sph_rad);
588 >        const double    leg_width = 2.*.75*(fabs(sph_xoffset) - sph_rad);
589          const double    leg_height = 2.*sph_rad;
590          const int       text_lines = 6;
591          const int       text_digits = 8;
# Line 686 | Line 684 | convert_mgf(const char *mgfdata)
684                  sprintf(cmdbuf, "xform -t %f %f %f -s %f -t %f %f 0 %s",
685                                  -.5*(xmin+xmax), -.5*(ymin+ymax), -zmax,
686                                  1.5*sph_rad/max_dim,
687 <                                -sph_xoffset, -2.5*sph_rad,
687 >                                sph_xoffset, -2.5*sph_rad,
688                                  radfn);
689                  if (!run_cmd(cmdbuf))
690                          return;
# Line 696 | Line 694 | convert_mgf(const char *mgfdata)
694                  sprintf(cmdbuf, "xform -t %f %f %f -s %f -ry 180 -t %f %f 0 %s",
695                                  -.5*(xmin+xmax), -.5*(ymin+ymax), -zmin,
696                                  1.5*sph_rad/max_dim,
697 <                                sph_xoffset, -2.5*sph_rad,
697 >                                -sph_xoffset, -2.5*sph_rad,
698                                  radfn);
699                  if (!run_cmd(cmdbuf))
700                          return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines