bright colors for pamela, design folder added to .gitignore

This commit is contained in:
sandb 2010-02-13 01:40:07 +01:00
parent 3655d2d49f
commit faa645ad3d
2 changed files with 35 additions and 6 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
uploads uploads
design

View File

@ -17,6 +17,33 @@
along with Pamela. If not, see <http://www.gnu.org/licenses/>. along with Pamela. If not, see <http://www.gnu.org/licenses/>.
*/ */
// Class color generator
function ColorGenerator() {
this.colors = [
[255, 0, 0],
[255, 255, 0],
[ 0, 255, 0],
[ 0, 255, 255],
[ 0, 0, 255],
[255, 0, 255]
];
this.colorGeneratorValue = 0;
}
ColorGenerator.prototype.generate = function() {
if (this.colorGeneratorValue > this.colors.length)
this.colorGeneratorValue = 0;
// weirdo fix for chrome bug where the colors get
// garbage collected. I think.
var c = this.colors[this.colorGeneratorValue++];
return [c[0], c[1], c[2]];
};
var colorGenerator = new ColorGenerator();
// Class Node // Class Node
function Node(name) { function Node(name) {
@ -25,10 +52,11 @@ function Node(name) {
this.setMode("newNode"); this.setMode("newNode");
var size = Math.min(width, height); var size = Math.min(width, height);
this.color = [ //this.color = [
Math.random() * 128, // Math.random() * 128,
Math.random() * 128, // Math.random() * 128,
Math.random() * 128]; // Math.random() * 128];
this.color = colorGenerator.generate();
this.position = new Vector( this.position = new Vector(
(Math.random() * size) - (size / 2), (Math.random() * size) - (size / 2),
(Math.random() * size) - (size / 2), (Math.random() * size) - (size / 2),
@ -67,7 +95,7 @@ Node.prototype.normal = {
draw: function() { draw: function() {
if (this.projection.z > -1) return; if (this.projection.z > -1) return;
var scale = width * 3 / -this.projection.z; var scale = width * 3 / -this.projection.z;
var alphaScale = this.alpha / 255; var alphaScale = 0.5 + this.alpha / 128;
var invAlphaScale = 1 - alphaScale; var invAlphaScale = 1 - alphaScale;
var col = var col =
/* [ /* [