Assign an image as a texture to a mesh

Hello,

I have a set of 3D points, which I triangulate with Triangle.Net after bringing them into 2D.
I want to assign a texture to those gameobjects, but it’s not really working and I don’t know why. Loading an image file is working great. It’s working if I create a primitive gameobject g (plane or sphere), load the image (byte data = File.ReadAllBytes(“path/to/image”); ) and assign it to the gameobject (Texture2D tex = new Texute2D(10, 10); and tex.loadData(data); and g.GetComponent().material.mainTexture = tex; ).
But if I use those gameobjects for which I only have those 3D points, which I triangulate and for which I create not primitive objects, then it’s not working. Those object have for the same image only one dark color.
In the first picture is a plane (primitive object) with the image as a texture and it looks fine. The second picture is a gameobject after computing the mesh for it with just one color.
What am i doing wrong or what do I have to change to assign the image properly?

Look up UV mapping.