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

Comparing ray/src/cv/mgf2rad.c (file contents):
Revision 2.2 by greg, Wed Jun 22 17:16:03 1994 UTC vs.
Revision 2.6 by greg, Fri Jul 1 18:06:36 1994 UTC

# Line 34 | Line 34 | char   *argv[];
34          mg_ehand[MG_E_COMMENT] = r_comment;
35          mg_ehand[MG_E_COLOR] = c_hcolor;
36          mg_ehand[MG_E_CONE] = r_cone;
37 +        mg_ehand[MG_E_CMIX] = c_hcolor;
38 +        mg_ehand[MG_E_CSPEC] = c_hcolor;
39          mg_ehand[MG_E_CXY] = c_hcolor;
40          mg_ehand[MG_E_CYL] = r_cyl;
41          mg_ehand[MG_E_ED] = c_hmaterial;
# Line 46 | Line 48 | char   *argv[];
48          mg_ehand[MG_E_RD] = c_hmaterial;
49          mg_ehand[MG_E_RING] = r_ring;
50          mg_ehand[MG_E_RS] = c_hmaterial;
51 +        mg_ehand[MG_E_SIDES] = c_hmaterial;
52          mg_ehand[MG_E_SPH] = r_sph;
53          mg_ehand[MG_E_TD] = c_hmaterial;
54          mg_ehand[MG_E_TS] = c_hmaterial;
# Line 337 | Line 340 | char   **av;
340                                          /* put out xform command */
341          printf("\n!xform");
342          oname = object();
343 <        if (*oname)
344 <                printf(" -n %s", oname);
343 >        if (*oname) {
344 >                printf(" -n ");
345 >                for (op = oname; op[1]; op++)   /* remove trailing separator */
346 >                        putchar(*op);
347 >        }
348          for (i = xa0; i < ac; i++)
349                  printf(" %s", av[i]);
350          if (ac > xa0 && xf_argc > 0)
# Line 396 | Line 402 | material()                     /* get (and print) current material */
402          double  d;
403          register int    i;
404  
405 <        if (c_cmaterial->name != NULL)
406 <                mname = c_cmaterial->name;
405 >        if (c_cmname != NULL)
406 >                mname = c_cmname;
407          if (!c_cmaterial->clock)
408                  return(mname);          /* already current */
409                                  /* else update output */
# Line 422 | Line 428 | material()                     /* get (and print) current material */
428                          c_cmaterial->rs + c_cmaterial->ts;
429          if (d <= 0. | d >= 1.)
430                  return(NULL);
431 <        if (c_cmaterial->td > .01 || c_cmaterial->ts > .01) {   /* trans */
431 >                                        /* check for trans */
432 >        if (c_cmaterial->td > .01 || c_cmaterial->ts > .01) {
433                  double  ts, a5, a6;
434  
435 <                ts = sqrt(c_cmaterial->ts);     /* because we use 2 sides */
435 >                if (c_cmaterial->sided) {
436 >                        ts = sqrt(c_cmaterial->ts);     /* approximate */
437 >                        a5 = .5;
438 >                } else
439 >                        a5 = 1.;
440                                                  /* average colors */
441                  d = c_cmaterial->rd + c_cmaterial->td + ts;
442                  cvtcolor(radrgb, &c_cmaterial->rd_c, c_cmaterial->rd/d);
# Line 435 | Line 446 | material()                     /* get (and print) current material */
446                  addcolor(radrgb, c2);
447                  if (c_cmaterial->rs + ts > .0001)
448                          a5 = (c_cmaterial->rs*c_cmaterial->rs_a +
449 <                                        ts*.5*c_cmaterial->ts_a) /
449 >                                        ts*a5*c_cmaterial->ts_a) /
450                                          (c_cmaterial->rs + ts);
451                  a6 = (c_cmaterial->td + ts) /
452                                  (c_cmaterial->rd + c_cmaterial->td + ts);
# Line 450 | Line 461 | material()                     /* get (and print) current material */
461                                  ts/(ts + c_cmaterial->td));
462                  return(mname);
463          }
464 <        if (c_cmaterial->rs < .01 || isgrey(&c_cmaterial->rs_c)) { /* plastic */
464 >                                        /* check for plastic */
465 >        if (c_cmaterial->rs < .01 || c_isgrey(&c_cmaterial->rs_c)) {
466                  if (c_cmaterial->rs > .999)
467                          cvtcolor(radrgb, &c_cmaterial->rd_c, 1.);
468                  else
# Line 486 | Line 498 | double intensity;
498   {
499          static COLOR    ciexyz;
500  
501 +        c_ccvt(ciec, C_CSXY);           /* get xy representation */
502          ciexyz[1] = intensity;
503          ciexyz[0] = ciec->cx/ciec->cy*ciexyz[1];
504          ciexyz[2] = ciexyz[1]*(1./ciec->cy - 1.) - ciexyz[0];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines