|
|
I'm trying to use this formula to plot the visible gamut in XYZ space.
http://www.brucelindbloom.com/index.html?Eqn_Spect_to_XYZ.html
Here is my code:
#local xSum = 0;
#local ySum = 0;
#local zSum = 0;
#local nSum = 0;
#for (i, 0, 89)
#local nSum = nSum + (xyz_table[i].y * D65_table[i]);
#end
#for (i, 0, 89)
#local xSum = 1/nSum * (xSum + xyz_table[i].x * 1 * D65_table[i]);
#for (j, 0, 89)
#local ySum = 1/nSum * (ySum + xyz_table[j].y * 1 * D65_table[j]);
#for (k, 0, 89)
#local zSum = 1/nSum * (zSum + xyz_table[k].z * 1 * D65_table[k]);
sphere
{
<xSum, ySum, zSum> * 10, 0.005
pigment {color rgb x}
}
#end
#end
#end
However, the resulting shape is box-shaped instead of cone-shaped. Am I
approaching things in the right way?
Mike
Post a reply to this message
|
|