I am having a hard time trying to change the color now... I opened up a previous noise sketch I had and I found out how to do it, but I am having a hard time applying it to my class "noiseMaker".
----------------------------------------------------------------------------------------------------------------------------------------------------------
NoiseMaker myNoiseMaker;
NoiseMaker myNoiseMaker2;
NoiseMaker myNoiseMaker3;
int co1;
int co2;
int co3;
void setup(){
size(600,100);
myNoiseMaker = new NoiseMaker(true);
myNoiseMaker2 = new NoiseMaker(false);
myNoiseMaker3 = new NoiseMaker(true);
}
void draw(){
myNoiseMaker.display(0);
myNoiseMaker2.display(width/2);
myNoiseMaker3.display(width/4);
if(mousePressed){
save("noiseTexture.tiff");
}
}
-----------------------------------------------------------------------------------------------------------------------------------
class NoiseMaker {
float xnoise = 0.0;
float ynoise = 0.0;
float inc = 0.08;
boolean onX;
NoiseMaker(boolean b){
onX = b; //onX is being assigned to b.
co1 = x;
co2 = y;
co3 = z;
x = background(255,0,0);
y = background(0,255,0);
z = background(0,0,255);
}
void display(float offset) {
for (int y =0; y <height; y++) {
for (int x = 0; x<width/2; x++) {
float c = noise(xnoise, ynoise) *255;
stroke(c);
point(x + offset, y);
if(onX){
xnoise += inc;
}else{
ynoise += inc;
}
}
}
}
//void co1(x){
// co1(x) = background(255,0,0);
//}
//void co2(y){
// co2(y) = background(0,255,0);
//}
//void co3(z){
// co3(z) = background(0,0,255);
//}
}
-----------------------------------------------------------------------------------------------------
I am trying to pass variables into the class' constructor, and I am trying to create functions for what I want and then apply them, but I am doing something wrong.