I’m generating some geometry in script; I have a number of quads each built from two triangles, the quads are not perfectly rectangular and are in the shape of a trapezium. However when they render the texture bends down the seam where the two triangles join (see the attached image). It looks affine mapped instead of perspective correct. Any idea on how I can fix this?
I believe it’s because your texture is being stretched i.e. your texture is rectangular but the mesh is a trapezium, which results in it stretching across the triangle. If you look at each individual triangle it makes sense. The diagonal between them, is an interpolation from one corner of the texture to an opposite, and they actually match up. But it’s because the other 2 corners of the trapezium are ‘squished in’ (in terms of expecting a rectangle) so it’s collapsing the shape inward and creating the appearance you see. You need to have proper texture coordinates if you want to avoid this.
If I adjust the UV coordinates then the texture mapped to the quad will no longer be rectangular and the effect that I am trying to create will be lost. Or are you talking about some other way of calculating the UV’s?
You need to not stretch the texture. It needs to be a trapezium shape within the texture itself.
An alternative is to instead of using a quad, use 4 triangles like a fan revolving around the center, that might help with the distortion.
