r2945 - trunk/data/qcsrc/common
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Nov 14 05:07:16 EST 2007
Author: div0
Date: 2007-11-14 05:07:10 -0500 (Wed, 14 Nov 2007)
New Revision: 2945
Modified:
trunk/data/qcsrc/common/util.qc
trunk/data/qcsrc/common/util.qh
Log:
oops... added something there too
Modified: trunk/data/qcsrc/common/util.qc
===================================================================
--- trunk/data/qcsrc/common/util.qc 2007-11-14 10:06:21 UTC (rev 2944)
+++ trunk/data/qcsrc/common/util.qc 2007-11-14 10:07:10 UTC (rev 2945)
@@ -180,3 +180,38 @@
result = strcat(substring(result, 0, len - decimals), ".", tmp);
return result;
}
+
+float time;
+vector colormapPaletteColor(float c, float isPants)
+{
+ switch(c)
+ {
+ case 0: return '0.733 0.733 0.733';
+ case 1: return '0.451 0.341 0.122';
+ case 2: return '0.000 0.733 0.733';
+ case 3: return '0.000 1.000 0.000';
+ case 4: return '1.000 0.000 0.000';
+ case 5: return '0.000 0.502 1.000';
+ case 6: return '0.812 0.561 0.169';
+ case 7: return '0.718 0.529 0.420';
+ case 8: return '0.765 0.545 0.667';
+ case 9: return '1.000 0.000 1.000';
+ case 10: return '0.639 0.529 0.482';
+ case 11: return '0.310 0.388 0.341';
+ case 12: return '1.000 1.000 0.000';
+ case 13: return '0.000 0.000 1.000';
+ case 14: return '1.000 0.502 0.000';
+ case 15:
+ if(isPants)
+ return
+ '1 0 0' * (0.502 + 0.498 * sin(time / 2.7182818285 + 0.0000000000))
+ + '0 1 0' * (0.502 + 0.498 * sin(time / 2.7182818285 + 2.0943951024))
+ + '0 0 1' * (0.502 + 0.498 * sin(time / 2.7182818285 + 4.1887902048));
+ else
+ return
+ '1 0 0' * (0.502 + 0.498 * sin(time / 3.1415926536 + 5.2359877560))
+ + '0 1 0' * (0.502 + 0.498 * sin(time / 3.1415926536 + 3.1415926536))
+ + '0 0 1' * (0.502 + 0.498 * sin(time / 3.1415926536 + 1.0471975512));
+ default: return '0.000 0.000 0.000';
+ }
+}
Modified: trunk/data/qcsrc/common/util.qh
===================================================================
--- trunk/data/qcsrc/common/util.qh 2007-11-14 10:06:21 UTC (rev 2944)
+++ trunk/data/qcsrc/common/util.qh 2007-11-14 10:07:10 UTC (rev 2945)
@@ -30,3 +30,5 @@
// converts a number to a string with the indicated number of decimals
// works for up to 10 decimals!
string ftos_decimals(float number, float decimals);
+
+vector colormapPaletteColor(float c, float isPants);
More information about the nexuiz-commits
mailing list