title: How to create a mesh dynamically In unity
body: <p>I have vertex that have a color value.</p>
  
  <p>I'd like to make a mesh using vertex with the same color values.</p>
  
  <p><a href="https://i.stack.imgur.com/soJyy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/soJyy.png" alt="enter image description here"></a></p>
  
  <p>This picture is an example.</p>
  
  <p>I took pictures with my Android Phone, and I did image segmentation on the object </p>
  
  <p>So I got a color value corresponding to the coordinate value.</p>
  
  <p>I succeeded in just making textures. please check the image.
  <a href="https://i.stack.imgur.com/ddHlB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ddHlB.png" alt="enter image description here"></a></p>
  
  <p>But I want a mesh object.</p>
  
  <p>Below is making texture code.</p>
  
  <pre><code>var pixel = await this.segmentation.SegmentAsync(rotated, scaled.width, scaled.height);
  // int pixel[][];                   // image segmentation using tensorflow
  
  Color transparentColor = new Color32(255, 255, 255, 0);  // transparent
  for (int y = 0; y &lt; texture.height; y++)
  {
        for (int x = 0; x &lt; texture.width; x++)
        {
               int class_output = pixel[y][x];   
  
                texture.SetPixel(x, y, pixel[y][x] == 0 ? transparentColor : colors[class_output]);
        }
  }
  texture.Apply();
  </code></pre>
  
  <p>How can I make a mesh object?</p>