3D Frustum Clipping with Textures

So I finally bothered to implement 3D clipping and one huge issue I have is the textures. Each triangle has its O,U, and V vectors defined as the vertex_3, vertex_1, and vertex_2 of the triangle, respectively. The triangle renders fine if it isn’t getting clipped. Clipping the triangle makes one (or two) triangles with new vertices and this causes the texture to be mapped incorrectly.

Any one know how to fix this? I tried making the new triangle(s)’ texture vectors the same as the texture vectors on the original unclipped triangle but this isn’t working.

You have to calculate the new texcoords. Try to visualize the tesselated triangle, or draw it with pen and paper, and figure out how texcoords are interpolated, to figure out which texcoords are at every pixel. Once you have that down, you can calculate texcoords for an arbitrary pixel, which leads you to the answer to your question.

Thank you!