How to properly map/texture a trapezoid quad?

How do I get the texture correctly stretched onto the trapezoid quad?

Hey Achim, I added a Texture SOP, it this the result you wanted?


trapezoid_texturing.tox (2.16 KB)

No. I’m sorry, I should have been more clear.

You just textured the quad after the distortion.
I want to texture first and then move the points and the whole texture is still on the quad, just stretched. Basically just like it would happen in a corner pin TOP.

If you subdivide the single quad into many smaller quads after the transformation, things look much better again. This is a lot of articles about this around the web, but basically the mathematically correct solution involves using all 4 texture coordinates (stpq) and filling the q in correctly for this one case. However we don’t support 4 component texture coordinates in TouchDesigner so you can’t use that solution unfortunately.

Have you seen the cornerPin SOP in the pallette?

Good point. I think Markus used similar math done manually in Python to get that result.

Not really. If you give the corner pin sop less subdivisions it suffers from exactly the same error