问题
I have a shape like this:
and the coordinates of the points are available (Vertices have x and y components)
My texture is:
A simple planar UV mapping gives me:
and what I desire is:
How to calculate vertex positions to get the desired mapping? Note that this is a math problem.
Also, I can tolerate stretching, as long as the vertices fall on the grassy side.
来源:https://stackoverflow.com/questions/26397115/calculating-uv-texture-coords-for-a-procedurally-generated-polygon