I'm looking into a problem that first occured very trivial to me, but i got stuck and it's becoming a major issue right now. I'd like to subdivide a triangle by its given UVs, e.g. if the UVs are going from -n...+m or if they are greater than 1. So for example if i have a U coordinate from -1.5 ... 4 i'd like to subdivide at -1.0, 0.0, 1.0, 2.0, 3.0. Here's a visualization of the polygons that can be generated. Triangulation is trivial of course.
My idea was to subdivide each edge separately for U and V and then find intersections and use these intersections to spawn triangles. However, i can't even find the rule how each line is constructed. Maybe someone can shed some light?
Thanks!