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

Comparing ray/src/rt/func.c (file contents):
Revision 1.8 by greg, Sat Apr 7 16:12:56 1990 UTC vs.
Revision 1.10 by greg, Sat Aug 4 11:47:46 1990 UTC

# Line 38 | Line 38 | double  sca;
38  
39          if (initfile != NULL) {
40                  loadfunc(initfile);
41 <                scompile(NULL, "Dx=$1;Dy=$2;Dz=$3;");
42 <                scompile(NULL, "Nx=$4;Ny=$5;Nz=$6;");
43 <                scompile(NULL, "Px=$7;Py=$8;Pz=$9;");
44 <                scompile(NULL, "T=$10;Rdot=$11;");
45 <                scompile(NULL, "S=$12;Tx=$13;Ty=$14;Tz=$15;");
46 <                scompile(NULL, "Ix=$16;Iy=$17;Iz=$18;");
47 <                scompile(NULL, "Jx=$19;Jy=$20;Jz=$21;");
48 <                scompile(NULL, "Kx=$22;Ky=$23;Kz=$24;");
41 >                scompile("Dx=$1;Dy=$2;Dz=$3;", NULL, 0);
42 >                scompile("Nx=$4;Ny=$5;Nz=$6;", NULL, 0);
43 >                scompile("Px=$7;Py=$8;Pz=$9;", NULL, 0);
44 >                scompile("T=$10;Rdot=$11;", NULL, 0);
45 >                scompile("S=$12;Tx=$13;Ty=$14;Tz=$15;", NULL, 0);
46 >                scompile("Ix=$16;Iy=$17;Iz=$18;", NULL, 0);
47 >                scompile("Jx=$19;Jy=$20;Jz=$21;", NULL, 0);
48 >                scompile("Kx=$22;Ky=$23;Kz=$24;", NULL, 0);
49                  funset("arg", 1, l_arg);
50                  funset("noise3", 3, l_noise3);
51                  funset("noise3a", 3, l_noise3a);
# Line 133 | Line 133 | register int  n;
133          double  sum;
134          register RAY  *r;
135  
136 <        n--;                            /* for convenience */
136 >        if (--n < 0)
137 >                goto badchan;
138  
138        if (n < 0 || n > 23)
139                error(USER, "illegal channel number");
140
141        if (n == 9) {                   /* distance */
142
143                sum = fray->rot;
144                for (r = fray->parent; r != NULL; r = r->parent)
145                        sum += r->rot;
146                return(sum * fxf.sca);
147
148        }
149        if (n == 10)                    /* dot product */
150                return(fray->rod);
151
139          if (n < 3)                      /* ray direction */
140  
141                  return( (       fray->rdir[0]*fxf.xfm[0][n] +
# Line 170 | Line 157 | register int  n;
157                                  fray->rop[2]*fxf.xfm[2][n-6] +
158                                               fxf.xfm[3][n-6] );
159  
160 +        if (n == 9) {                   /* distance */
161 +
162 +                sum = fray->rot;
163 +                for (r = fray->parent; r != NULL; r = r->parent)
164 +                        sum += r->rot;
165 +                return(sum * fxf.sca);
166 +
167 +        }
168 +        if (n == 10)                    /* dot product */
169 +                return(fray->rod);
170 +
171          if (n == 11)                    /* scale */
172                  return(fxf.sca);
173  
# Line 184 | Line 182 | register int  n;
182  
183          if (n < 24)                     /* k unit vector */
184                  return(fxf.xfm[2][n-21] / fxf.sca);
185 + badchan:
186 +        error(USER, "illegal channel number");
187   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines