POV-Ray : Newsgroups : povray.advanced-users : D65 spectral locus : D65 spectral locus Server Time
24 Apr 2024 22:17:01 EDT (-0400)
  D65 spectral locus  
From: Mike Horvath
Date: 16 Mar 2017 11:49:24
Message: <58cab404$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.