First… create a new mesh
Create vertices… based on a 1x1 block (values should be in each corner zero, zero to one, one
Calculate the new vertices… This is really however you are doing it, but the x, or y of that vertices MUST be on either one or zero. The other value is part of the cut.
Next comes figuring out which vertex(vertices) are not going to be used. So say, you have zero, zero, and your angle cuts off one, one… this still will leave you zero,one and one,zero as well as two vertices that you created.
Now, you will have (zero, zero), (one, zero), (zero, one), (one, one), (vertexX), (vertexY)
Now you create faces based on what you are using. Each face is a list of 3 integers which correspond to the number of a vertex.
(0, 1, 2), (2, 1, 4), (1, 5, 4)
yes, we are not using 3 beacuse it is an unused vertex.
Lastly, we update the UV’s. UV’s are texture coordinates that correspond to zero, zero to one, one… Since our triangle doesn’t exceed these measurements. then we can use the vertex X and Y as the U and V. Each vertex must have a UV. Each UV corresponds to a vertex.
The whole process is actually mathematical… you will have to look up triangle splitting or rectangle splitting. This will get you very close to the ball park of what you want.