Hi, I'm trying to remove every other mesh face so that I get a checkboard/chessboard effect. At the moment, this code below doesn't work on every mesh, only ones where the face numbers for the mesh are in a very particular order. Does anyone know how I can do this simply?
Here's what I'm currenlty trying, but it just deletes every prim and it leaves nothing. I thought that the list of polyneighbors would eventually return nothing and then it would just leave the checkerboard, but I think I don't quite know how to do this sort of operation with vex.
for (inti=0; i<@primnum; i++) {intpn[] = polyneighbours(0, i);
if (len(pn)>1) {foreach(intpr; pn){removeprim(0,pr,1);
}}}
one possible way might be using an integer attribute for each prim and using polyneighbours() to grow a selection from an initial polygon. So the first polygon has value 0, in the next step all its neighbours will have value 1, in the next step all neighbours of these neighbours will have value 2 and so on.