PDA

View Full Version : Texture Coord for a point on the edge of a triangle.



dabeav
01-12-2004, 07:31 AM
Ok, I am currently splitting polys for a BSP_tree style of algorithm (not exactly though). My question is this. I have a Triangle PT1 PT2 PT3 are its points. When I split the poly, I take a line starting at PT1 and extend to cut across the Line that PT2-PT3 forms. Basicaly if you fold a poly in half by one of its verticies. Now I am left with a cross point on the line formed by PT2-PT3. Now, what I am attempting to figure out, is what the TX coords for that point would be, using the originals as a guide. I tried subracting the Respective Texture Coords from PT2,PT3, then taking the ratio of the distance from PT2toCrossPT/PT2toPT3 and multiplying that ratio to the subtracted TX, but it dosnt seem to work out.

What would be a good method to get the TX coords of such a point. What I know (The orignal PTs and there TX coords, The NEW point and what line it lyes on).

Thank you for any help.

cass
01-12-2004, 07:57 AM
PTnew = (PT2 + PT3) / 2

for all attributes...