# Procedural Mesh: UV mapping

I made a procedural mesh and now I want to apply a texture to it. The problem is, I cannot get it to stick the way I want it to.

The idea is to have the texture painted only once over the whole mesh, so that there is no repeating. How should I map the UV to make that happen?

My mesh is a simple plane consisting of 56 triangles. I'd add pictures to clear things up but I cannot since my reputation is below 10 points.

Any help is appreciated.

EDIT(Kind people gave me up votes, thank you):

Meet my mesh:

And when textured(tried to repeat the texture):

And my texture:

EDIT 2:

bummzack's instructions worked like a charm and the mesh got textured just as I wanted it to. Thank you.

-
Now you can ;-) – Valmond Mar 23 '12 at 8:46
Nice! The one with the repeated texture looks quite mesmerizing too :) – bummzack Mar 23 '12 at 14:00
I love the one with the repeated texture. Looks awesome. Would you care telling what you did to achieve that effect? – kaoD Mar 23 '12 at 16:53
I concur. How did you do that? – Boreal Mar 23 '12 at 18:05
But of course I'll share :). I made the UVs go this series all the way through: (0,1);(1,1);(0,0); The vertices are ordered one vertical line(Zs) down step right(x+1) and another vertical line down... – Esa Mar 23 '12 at 18:28

To map your texture once on the mesh, your UV coordinates should go from `0..1` over the whole mesh. But depending on the mesh at hand, this can get really tricky.

Since it's a plane, this should be simpler. Just look at the plane from it's "up" direction and assign `0,0` to the top left and `1,1` to bottom right. The vertices in between should be fractions. Eg. a vertex in the middle would have `0.5, 0.5` as UV coordinate.

Here's an example:

``````   0,0         0.33,0      0.66,0      1,0
+-----------+-----------+-----------+
|           |           |           |
| 0,0.25    | 0.33,0.25 | 0.66,0.25 | 1,0.25
+-----------+-----------+-----------+
|           |           |           |
|           |           |           |
|           |           |           |
|           |           |           |
|           |           |           |
| 0,1       | 0.33,1    | 0.66,1    | 1,1
+-----------+-----------+-----------+
``````
-
Ah! Of course! I'll be giving this one a go, thank you. – Esa Mar 23 '12 at 10:37