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

Comparing ray/src/rt/t_data.c (file contents):
Revision 1.5 by greg, Thu Oct 5 07:23:19 1989 UTC vs.
Revision 1.6 by greg, Sat Dec 15 15:03:42 1990 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1989 Regents of the University of California */
1 > /* Copyright (c) 1990 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 31 | Line 31 | static char SCCSid[] = "$SunId$ LBL";
31   *  to get from the original coordinates to the current coordinates.
32   */
33  
34 typedef struct {
35        struct {
36                double  sca;            /* scale factor */
37                double  xfm[4][4];      /* transformation matrix */
38        }  fore, back;
39 }  XFORM;
34  
41
35   t_data(m, r)                    /* interpolate texture data */
36   register OBJREC  *m;
37   RAY  *r;
# Line 50 | Line 43 | RAY  *r;
43          double  pt[MAXDIM];
44          double  d;
45          DATARRAY  *dp;
46 <        register XFORM  *mxf;
46 >        register FULLXF  *mxf;
47          register char  **sa;
48          register int  i;
49  
# Line 61 | Line 54 | RAY  *r;
54          for (i = 7; i < m->oargs.nsargs && sa[i][0] != '-'; i++)
55                  ;
56          nv = i-7;
57 <        if ((mxf = (XFORM *)m->os) == NULL) {
58 <                mxf = (XFORM *)malloc(sizeof(XFORM));
57 >        if ((mxf = (FULLXF *)m->os) == NULL) {
58 >                mxf = (FULLXF *)malloc(sizeof(FULLXF));
59                  if (mxf == NULL)
60                          goto memerr;
61 <                if (xf(mxf->fore.xfm, &mxf->fore.sca,
69 <                        m->oargs.nsargs-i, sa+i) != m->oargs.nsargs-i)
61 >                if (fullxf(mxf, m->oargs.nsargs-i, sa+i) != m->oargs.nsargs-i)
62                          objerror(m, USER, "bad transform");
63 <                if (mxf->fore.sca < 0.0)
64 <                        mxf->fore.sca = -mxf->fore.sca;
65 <                invxf(mxf->back.xfm, &mxf->back.sca,
66 <                                m->oargs.nsargs-i, sa+i);
75 <                if (mxf->back.sca < 0.0)
76 <                        mxf->back.sca = -mxf->back.sca;
63 >                if (mxf->f.sca < 0.0)
64 >                        mxf->f.sca = -mxf->f.sca;
65 >                if (mxf->b.sca < 0.0)
66 >                        mxf->b.sca = -mxf->b.sca;
67                  m->os = (char *)mxf;
68          }
69  
70 <        setmap(m, r, mxf->back.xfm, mxf->back.sca);
70 >        setmap(m, r, &mxf->b);
71  
72          if (nv > MAXDIM)
73                  goto dimerr;
# Line 100 | Line 90 | RAY  *r;
90          if (errno)
91                  goto computerr;
92  
93 <        multv3(disp, disp, mxf->fore.xfm);
94 <        multv3(disp, disp, r->rofx);
95 <        d = 1.0 / (mxf->fore.sca * r->rofs);
93 >        multv3(disp, disp, mxf->f.xfm);
94 >        if (r->rox != NULL) {
95 >                multv3(disp, disp, r->rox->f.xfm);
96 >                d = 1.0 / (mxf->f.sca * r->rox->f.sca);
97 >        } else
98 >                d = 1.0 / mxf->f.sca;
99          for (i = 0; i < 3; i++)
100                  r->pert[i] += disp[i] * d;
101          return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines