We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Ciao everyone! I want modify a surface give from a beginShape(TRIANGLES) created from a double cycle for of x,y of points (vertex). I would like to extrude some triangles on z axis, but when i try, it create just a triangle flat on z and it loose the connection surface with near points. I am building the surface like that:
for (int y=0; y < steps; y+=steps;) {
for(int x=0;x < kdw-steps;x+=steps;)
{
i00 = x + y * maxY;
i01 = x + y + steps_* maxY;
i10 = (x + steps) + y * maxY;
i11 = (x + steps) +y + steps_* maxY;
p00 = totalPoints[i00];
p01 = totalPoints[i01];
p10 = totalPoints[i10];
p11 = totalPoints[i11];
beginShape(TRIANGLES);
if ((p00.z > 0) && (p01.z > 0) && (p10.z > 0) && // check for non valid values
(abs(p00.z-p01.z) < max_edge_len) && (abs(p10.z-p01.z) < max_edge_len)) { // check for edge length
vertex(p00.x,p00.y,p00.z);
vertex(p01.x,p01.y,p01.z);
vertex(p10.x,p10.y,p10.z);
}
if ((p11.z > 0) && (p01.z > 0) && (p10.z > 0) &&
(abs(p11.z-p01.z) < 50) && (abs(p10.z-p01.z) < max_edge_len)) {
vertex(p01.x,p01.y,p01.z);
vertex(p11.x,p11.y,p11.z);
vertex(p10.x,p10.y,p10.z);
}
endShape(); }}
Any help please?
Comments
could you show the entire code pls?
did you read the tutorial?
https://www.processing.org/tutorials/pshape/
very last section