There is a stl model(triangular mesh). I want to use a adjustable, rectangular shape to make selections. Like below picture.
But I don't want the triangles on the other side are selected. That's to say only the visible triangles in the rectangular can be selected.
AFAIK, there is a method to do this. First render each triangle with a specific and unique color. Then, retrieve the color of the pixels in the select rectangular, and convert those colors back to the original identifier. The triangle own the id is selected. I think this method is workable but inefficient.
So is there any other better method to do this selection? More elegant and efficient one?