Hello all,
the reference has Quad_Strip, but only for one line of quads.
How can I make a bigger grid of QUAD_STRIP?
Actually, the main problem is the line break at the end of one line in the grid. I don’t want the right side to be connected with the left side of the next line in the grid.
Part of a MUCH bigger project, but here is an example.
As you can see, the values are in MyResults, which is a 2D array (grid) of PVector.
I struggle with the vertexPV() command .
Or do I have to say endshape() after each line in the grid which would be rather uncool?
Thank you!!!
void ShowLookupAsGrid() {
// nice
colorMode(RGB, 400);
noStroke();
if ((MaxindexI <= 0) && (MaxindexJ <= 0)) {
ShowSpecialMessage("LookUp-Table not defined.");
} else {
beginShape(QUAD_STRIP);
noStroke();
for (int j = 0; j < MaxindexJ; j = j+1) {
for (int i = 0; i < MaxindexI; i = i+1) {
fill (2+abs(MyResults[i][j].x), 2+abs(MyResults[i][j].y), 2+abs(MyResults[i][j].z));
if (keyPressed) {
vertexPV(MyResults[i][j]);
vertexPV(MyResults[i][j+1]);
} else {
boxPV(MyResults[i][j]);
}
} // j
} //i
endShape(CLOSE);
} // else
} // ShowGraph2
void vertexPV(PVector pv) {
vertex(pv.x, pv.y, pv.z);
}
void pointPV(PVector pv) {
point(pv.x, pv.y, pv.z);
}
void boxPV(PVector pv) {
pushMatrix();
translate(pv.x, pv.y, pv.z);
box(2);
popMatrix();
}
void spherePV(PVector pv) {
pushMatrix();
translate(pv.x, pv.y, pv.z);
sphere(2);
popMatrix();
}
As you can see it looks awful, because the lines are connected:
compared to what it’s meant to look like (here I just use box() command)
Thank you all!
Warm regards,
Chrisir