I used this script to draw some polygons:
http://wiki.unity3d.com/index.php?title=Triangulator
I changed this part, to set the base texture coordinates of the mesh:
// Create the Vector3 vertices
Vector3[] vertices = new Vector3[vertices2D.Length];
Vector2[] uvs = new Vector2[vertices2D.Length];
for (int i = 0; i < vertices.Length; i++)
{
vertices <em>= new Vector3(vertices2D_.x, vertices2D*.y, 0);*_</em>
uvs = new Vector2(vertices2D_.x, vertices2D*.y);
}
msh.uv = uvs;
Now I set a material to the created GameObject, like this:
polygonObject.GetComponent().material = blueMaterial;
The material of the GameObject has changed, but it now consists of thousands of small pictures of the desired one:
[82787-wood.jpg*|82787]*
The picture isn’t a small one (1600x1200). The size of the picture in the background is like (2600x1600). So there is clearly something wrong.
How can I get this fixed, so the material of the GameObject fits the picture?
_*