Hi,
I have a terrain mesh generator that generates cliffs in the mesh,
very similar to the terrain used in Warcraft 3.
See the brown parts in this:
http://img178.imageshack.us/img178/8168/terrainwithcliff.jpg
Now I want to generate UV coordinates for using a tiled texture on it.
I figured that it might be a lot easier than generic unwrapping since
the mesh is always vertically aligned. (i.e. the world "up" axis can
always be mapped to V). Also, I don't mind if different, non-connected
parts of the UV map are overlapping. Basically, I just want to remove
seams as good as possible from the mesh, while applying the tiled
texture.
Can anybody think of a good algorithm to do that? Possibly even one
that would generate no seams at all? (This should be possible since
the cliffs are, at least on one level, at most topologically equivalent to
a cylinder)
My only idea so far is to compute a "perfect" projection for each triangle
and stuff the edge conditions into a linear equations solver, possibly
with a finite-field for the "wrap-around" effect, but that seems like a
huge overkill, especially since I want to generate this at runtime.
Thanks,
Marius
|