I have code that generates triangle mesh from 2d shapes. Because those shapes in most cases have uneven vertex distribution on the surface I have an issue with generation of UVs so that it wouldn't cause texture distortion. Anybody can suggest some articles, books, code samples that talk about techniques of UV calculation on planar meshes? Thanks
ok lets see if I understood your question.
you can then translate all your vertices by -1*(x_0, y_0), then (0,0) maps to (0,0) on the meshes coord system and (1,1) maps to a new coord (x_1', y_1')
So for any vertex in your mesh with new coords (x_i', y_i') the corresponding uv-coordinate is: (x_i' / x_1', y_i' / y_1')
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With