Luminance mapping - Radiance Workshop 2003
Santiago Torres – The University of Tokyo
10 / 14
Luminance mapping
{
Calculate coordinates for mapping an image onto a
source.
A1-A4 must be the same as in the source
definition.
A1 = X component of the
source direction vector
A2 = Y component
A3 = Z component
A4 = size of the source
[degrees]
}
mapsou_u = .5 + mapsou_Dx/mapsou_Rxz * mapsou_Ry;
mapsou_v = .5 + mapsou_Dz/mapsou_Rxz * mapsou_Ry;
mapsou_Rxz = sqrt(mapsou_Dx*mapsou_Dx + mapsou_Dz*mapsou_Dz);
mapsou_Ry = acos(mapsou_Dy) * 180/(PI*A4);
mapsou_Dx = Dx * cos_be - Dy2 * sin_be;
mapsou_Dy = Dx * sin_be + Dy2 * cos_be;
mapsou_Dz = Dy * sin_al + Dz * cos_al;
Dy2 = Dy * cos_al - Dz * sin_al;
sin_al = -A3 / diag1;
cos_al = A2 / diag1;
sin_be = A1 / diag2;
cos_be = diag1 / diag2;
diag1 = sqrt ( A2*A2 + A3*A3 );
diag2 = sqrt ( A1*A1 + A2*A2 + A3*A3 );
Mapping to source – mapsou.cal
void colorpict sol
7 red green blue sol2.pic mapsun.cal mapsun_u mapsun_v
0
4 -.07 1 .13 5
sol glow solrad
0
0
4 1 1 1 0
solrad source sol
0
0
4 -.07 1 .13 5
by
AMcneil
– last modified
Feb 29, 2016 12:26 PM