the type of the expression must be an array type but it resolved to int
in
Programming Questions
•
1 years ago
Is anyone familiar with this error message? why does this happen.. not sure..
"the type of the expression must be an array type but it resolved to int"
Not clear on how to modify..
This is my code
int shapes = 200;
int[] x = new int[shapes];
int[] y = new int[shapes];
int[] z = new int[shapes];
float a = 0;
void setup(){
size(400,400,P3D);
smooth();
noFill();
for (int p = 0;p < shapes; p++){
x[p] = int(random(-150,150));
y[p] = int(random(-150,150));
z[p] = int(random(-150,150));
}
}
void draw(){
background(0);
translate(width/2,height/2);
rotateY(frameCount/100.0);
for( int i = -200;i< 600; i += 200){
for( int j = -200;j< 600; j += 200){
collection(i,j);
}
}
}
void collection(int x, int y){
float t = frameCount/1000.0;
float y2 = sin(a) * 25;
float x2 = cos(a) * 25;
for (int p = 0;p < shapes; p++){
line(noise(1,p,t)*x[p],noise(2,p,t)*y[p],noise(3,p,t)*z[p],x[p],y[p],z[p]);
stroke(255);
}
a = a + 1;
}
1