Hey guys, i’ve been working on this for a while, and I’m having difficulties inserting one of my functions into the loop, without it messing the rest or simply not showing. I just want to put dots over everything, but I can’t figure it out. If you could try to figure it out I would be so relieved haha. Thanks in advanced. I just like want stars to show up at the top or everywhere
//Global Variables
int c,r; //rows/coloms
int space=10; //space
int w=1920; //width of
int h=1080;//height of
float[][] tgrid;
float cloud=0;
void setup(){
size(1920,1080,P3D);
c=w/space;
r=h/space;
tgrid=new float [c][r];
}
void draw(){
cloud-=0.04; //cloud speed
float moveY=cloud;
for(int y=0; y<r;y++){
float moveX=2;
for(int x=0; x<c;x++){
tgrid[x][y]=map(noise(moveX,moveY),0,1,-150,150);
moveX +=0.05;
}
moveY +=0.05;
}
background(0);
stroke(#4C6FEA);
noFill();
translate(width/2,height/2);
rotateX(PI/2.6);
translate(-w/2,-h/2);
for (int y=0; y<r-1;y++){
beginShape(TRIANGLES);
for(int x=0; x<c;x++){
vertex(x*space,y*space,tgrid[x][y]);
vertex(x*space,(y+1)*space,tgrid[x][y+1]);
}
endShape();
}
starField(10,10,250,0,0);
//myLine(140, 200, 1, 100, 1000, 1920, 100);
myLine(#FFE079, 10, 20, -100, 0, 0, 30);
}
void myLine(int colour, int transparency, int weight, int size, int midpointX, int midpointY, int separation){
for(int y = 0; y < 2000; y = y + separation)
{
for (int x = 0; x < 2000; x = x + separation)
{
stroke(colour, transparency);
strokeWeight(weight);
line(midpointX, midpointY, x + size , y + size);
}
}
}
//I'm trying to put this function in as well but I have no idea how. I just want points to appear and disappear, or simply point that appear on my screen over the rest.
void starField(float xstar, float ystar, int rstar, int gstar, int bstar, int fRate1, int fRate2) {
frameRate(fRate1);
fill(0,30);
rect(0,0,width,height);
rameRate(fRate2);
fill(rstar,gstar,bstar);
noStroke();
ellipse(random(width),random(height),xstar,ystar);
}