123 |
|
static CMATRIX * |
124 |
|
cm_bsdf_Lamb(const COLOR diffBSDF) |
125 |
|
{ |
126 |
< |
CMATRIX *cm = cm_alloc(145, 145); /* this is a hack */ |
127 |
< |
int r, c; |
126 |
> |
CMATRIX *cm = cm_alloc(145, 145); /* this is a hack */ |
127 |
> |
ANGLE_BASIS *abase = abase_list; |
128 |
> |
int r, c; |
129 |
|
|
130 |
< |
for (c = 0; c < cm->ncols; c++) |
130 |
> |
while (abase->nangles != cm->nrows) |
131 |
> |
if (++abase >= abase_list+nabases) |
132 |
> |
error(INTERNAL, "Code error in cm_bsdf_Lamb()"); |
133 |
> |
|
134 |
> |
for (c = 0; c < cm->ncols; c++) { |
135 |
> |
const double dom = io_getohm(c,abase); |
136 |
|
for (r = 0; r < cm->nrows; r++) { |
137 |
|
COLORV *mp = cm_lval(cm,r,c); |
138 |
|
copycolor(mp, diffBSDF); |
139 |
+ |
scalecolor(mp, dom); |
140 |
|
} |
141 |
+ |
} |
142 |
|
return(cm); |
143 |
|
} |
144 |
|
|