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

Comparing ray/src/cv/mgflib/xf.c (file contents):
Revision 1.5 by greg, Wed Jun 29 16:15:25 1994 UTC vs.
Revision 1.8 by greg, Tue Apr 18 16:52:28 1995 UTC

# Line 40 | Line 40 | char   **av;
40          register XF_SPEC        *spec;
41          register int    n;
42          int     rv;
43        XF      thisxf;
43  
44          if (ac == 1) {                  /* something with existing transform */
45                  if ((spec = xf_context) == NULL)
# Line 78 | Line 77 | char   **av;
77                  xf_context = spec;
78          }
79                                          /* translate new specification */
80 <        if (xf(&thisxf, spec->xac, &xf_argv[spec->xav0]) != spec->xac)
80 >        if (xf(&spec->xf, spec->xac, &xf_argv[spec->xav0]) != spec->xac)
81                  return(MG_ETYPE);
82 +                                        /* check for vertex reversal */
83 +        if ((spec->rev = (spec->xf.sca < 0.)))
84 +                spec->xf.sca = -spec->xf.sca;
85                                          /* compute total transformation */
86          if (spec->prev != NULL) {
87 <                multmat4(spec->xf.xfm, spec->prev->xf.xfm, thisxf.xfm);
88 <                spec->xf.sca = spec->prev->xf.sca * thisxf.sca;
89 <        } else
90 <                spec->xf = thisxf;
87 >                multmat4(spec->xf.xfm, spec->xf.xfm, spec->prev->xf.xfm);
88 >                spec->xf.sca *= spec->prev->xf.sca;
89 >                spec->rev ^= spec->prev->rev;
90 >        }
91          spec->xid = comp_xfid(spec->xf.xfm);    /* compute unique ID */
92          return(MG_OK);
93   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines