# Best way to split a triangle

This topic is 3965 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

What is the best algorithm for splitting a triangle, keeping in mind that the triangle has UV coords that must be kept perspective correct when split. Will simply interpolating the UV coordinates to the point of intersection along the edge of the polygon yield correct results? The goal, obviously, is that when one triangle is split into to, the two should render and appear as one continuous triangle. The triangle will always be split along one of the primary axis (X,Y, or Z)

##### Share on other sites
I suppose it would be silly to ask why you're doing this - the two resulting triangles will be coplanar, and if the appearance of the result (the 2 rendered triangles) should be identical to that of the original (the un-split triangle), then you lose efficiency.
If you're trying to decompose or tesselate an object (such as a theoretical or mathematical shape), try this explanation to start.

I think you are correct in your approach to the UV coordinates - interpolation is exactly what OpenGL uses when rasterizing the texture to the screen.

##### Share on other sites
The "best" method that I can think of, for triangle ABC is to take point D, in the middle of line AC, and then form triangles ABD and BCD.

klaymore142 is correct, however, your two triangles will be coplanar. If you intend to render a scene with a lot of lighting, consider using lightmaps instead. The new point, point D, would be halfway between points A and C on the UV map.

##### Share on other sites
Try searching for "triangle longest edge bisection". I think this is what speciesUnknown talks about too.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 9
• 9
• 34
• 16
• ### Forum Statistics

• Total Topics
634123
• Total Posts
3015654
×