calculating UV coordinates of arbitrary meshes

Hi all. I am generating planar meshes from 2d splines. I have an issue with UV generation for the vertices so that the textrue would not look distorted. That is because the triangles are not uniform across the surface. Anyone can point out to relevant algorithms ,code samples or any other referencesrefer which deal with this problem.
Thanks for help in advance.

The texture is going to be distorted, one way or another. There’s no way to map a square onto an arbitrarily curved 2D surface without distortion. You can’t just throw any image onto any surface and expect it to work.

What you need to do is have your textures be designed for the distortion. You need to have your textures built around the mapping. That’s why being a texture artist is hard.

Sorry, let me explain myself.What I mean is that the mesh is flat- planar.
There are no extrusions along the Y (up) . In 3DS Max and in other visual packages you can see the spline shapes triangulated and then after applying planar UV mapping the textures look just fine. That is what I need basically.

If you can have a DDC tool create correct UVs, why don’t you use the same coordinates with OpenGL?

I am generating a planar mesh in procedural way. It may have a varying number of segments and vertices.But never mind ,I have found the solution . :slight_smile: