Connecting stripes problem
in
Programming Questions
•
2 years ago
Hi,
I'm using a processing for quite a while, but this time, I'm stucked.
I'm trying to do something like stripes on lower part of this
image, generaly stripes with kinda perspective distortion. I used for loop to generate coordinates for x-axis for quads, but for some reason, quads are drawing across each other, almost like connected to each other. This is a source code:
- void setup() {
size(400,400);
smooth();
}
void draw() {
background(255);
skewY(120);
cube(-200,-100);
}
void cube(float xpos, float ypos) {
pushMatrix();
scale(2);
translate((width/2)+xpos, (height/2)+ypos);
float tall = 40;
float y1 = -tall;
float y2 = tall;
for(int i = 16; i < 32; i = i+8) {
for(int j = 0; j < 64; j = j+32){
strokeWeight(0.5);
quad(0+i, y1, 6+i, y1, 6+j, y2, 0+j, y2);
}
}
popMatrix();
}
Hope anyone can help me figure this one out.
Thanks in advance forum!
1