Row of Noise
in
Programming Questions
•
1 year ago
Hello everyone,
So I have temporarily moved my sphere project aside, noting on how difficult it is and I just haven't gotten anywhere on it really, and am trying to work on a new noise demo with which I am trying to create a row of noise with different colors. I am very close as usual I believe, but it wouldn't hurt to get some extra input. Here is my code for this project..................................................................................................................................................
NoiseMaker myNoiseMaker;
NoiseMaker2 myNoiseMaker2;
void setup(){
myNoiseMaker = new NoiseMaker();
myNoiseMaker2 = new NoiseMaker2();
size(600,100);
}
void draw(){
myNoiseMaker.display();
myNoiseMaker2.display();
if(mousePressed==true){
save("noiseTexture.tiff");
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is my first tab for my NoiseMaker class--------------------------------------------------------------------------------------------------
class NoiseMaker {
float xnoise = 0.0;
float ynoise = 0.0;
float inc = 0.08;
NoiseMaker(){
xnoise = 0;
ynoise = ynoise +inc;
}
void display() {
for (int y =0; y <height; y++) {
for (int x = 0; x<width; x++) {
float gray = noise(xnoise, ynoise) *255;
stroke(gray);
point(x, y);
xnoise = xnoise + inc;
size(100,100);
}
}
}
}
The second class I have is basically a copy of the first NoiseMaker class. I figured I would just create more classes because I couldn't seem to figure out how to make more Noise blocks.
Here is the second class-----------------------------------------------------------------------------------------------------------------------------------
class NoiseMaker2 {
float xnoise = 0.0;
float ynoise = 0.0;
float inc = 0.08;
NoiseMaker2(){
xnoise = 0;
ynoise = ynoise +inc;
}
void display() {
for (int y =0; y <height; y++) {
for (int x = 0; x<width; x++) {
float YELLOW = noise(xnoise, ynoise) *255;
stroke(YELLOW);
point(x, y);
xnoise = xnoise + inc;
size(100,100);
translate(width/2,height/2);
}
}
}
}
------------------------------------------------------
Any help would be great thank you.
Safety and Peace,
playalot86
So I have temporarily moved my sphere project aside, noting on how difficult it is and I just haven't gotten anywhere on it really, and am trying to work on a new noise demo with which I am trying to create a row of noise with different colors. I am very close as usual I believe, but it wouldn't hurt to get some extra input. Here is my code for this project..................................................................................................................................................
NoiseMaker myNoiseMaker;
NoiseMaker2 myNoiseMaker2;
void setup(){
myNoiseMaker = new NoiseMaker();
myNoiseMaker2 = new NoiseMaker2();
size(600,100);
}
void draw(){
myNoiseMaker.display();
myNoiseMaker2.display();
if(mousePressed==true){
save("noiseTexture.tiff");
}
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is my first tab for my NoiseMaker class--------------------------------------------------------------------------------------------------
class NoiseMaker {
float xnoise = 0.0;
float ynoise = 0.0;
float inc = 0.08;
NoiseMaker(){
xnoise = 0;
ynoise = ynoise +inc;
}
void display() {
for (int y =0; y <height; y++) {
for (int x = 0; x<width; x++) {
float gray = noise(xnoise, ynoise) *255;
stroke(gray);
point(x, y);
xnoise = xnoise + inc;
size(100,100);
}
}
}
}
The second class I have is basically a copy of the first NoiseMaker class. I figured I would just create more classes because I couldn't seem to figure out how to make more Noise blocks.
Here is the second class-----------------------------------------------------------------------------------------------------------------------------------
class NoiseMaker2 {
float xnoise = 0.0;
float ynoise = 0.0;
float inc = 0.08;
NoiseMaker2(){
xnoise = 0;
ynoise = ynoise +inc;
}
void display() {
for (int y =0; y <height; y++) {
for (int x = 0; x<width; x++) {
float YELLOW = noise(xnoise, ynoise) *255;
stroke(YELLOW);
point(x, y);
xnoise = xnoise + inc;
size(100,100);
translate(width/2,height/2);
}
}
}
}
------------------------------------------------------
Any help would be great thank you.
Safety and Peace,
playalot86
1