title: How do I properly setup a texture position using XNA/Monogame VertexPositionTexture on a circle
body: <p>I am using the following to create a circle using VertexPositionTexture:</p>
  
  <pre><code>public static ObjectData Circle(Vector2 origin, float radius, int slices)
  {
      /// See below
  }
  </code></pre>
  
  <p>The texture that is applied to it doesn't look right, it spirals out from the center. I have tried some other things but nothing does it how I want.  I would like for it to kind-of just fan around the circle, or start in the top-left end finish in the bottom-right. Basically wanting it to be easier to create textures for it.</p>
  
  <p>I know that are MUCH easier ways to do this without using meshes, but that is not what I am trying to accomplish right now.</p>
  
  <p>This is the code that ended up working thanks to Pinckerman:</p>
  
  <pre><code> public static ObjectData Circle(Vector2 origin, float radius, int slices)
  {
      VertexPositionTexture[] vertices = new VertexPositionTexture[slices + 2];
      int[] indices = new int[slices * 3];
  
      float x = origin.X;
      float y = origin.Y;
  
      float deltaRad = MathHelper.ToRadians(360) / slices;
      float delta = 0;
  
      float thetaInc = (((float)Math.PI * 2) / vertices.Length);
  
      vertices[0] = new VertexPositionTexture(new Vector3(x, y, 0), new Vector2(.5f, .5f));
      float sliceSize = 1f / slices;
  
      for (int i = 1; i &lt; slices + 2; i++)
      {
          float newX = (float)Math.Cos(delta) * radius + x;
          float newY = (float)Math.Sin(delta) * radius + y;
  
          float textX = 0.5f + ((radius * (float)Math.Cos(delta)) / (radius * 2));
          float textY = 0.5f + ((radius * (float)Math.Sin(delta)) /(radius * 2));
  
          vertices[i] = new VertexPositionTexture(new Vector3(newX, newY, 0), new Vector2(textX, textY));
  
          delta += deltaRad;
      }
  
      indices[0] = 0;
      indices[1] = 1;
      for (int i = 0; i &lt; slices; i++)
      {
          indices[3 * i] = 0;
          indices[(3 * i) + 1] = i + 1;
          indices[(3 * i) + 2] = i + 2;
      }
  
      ObjectData thisData = new ObjectData()
      {
          Vertices = vertices,
          Indices = indices
      };
      return thisData;
  }
  
  public static ObjectData Ellipse()
  {
      ObjectData thisData = new ObjectData()
      {
      };
      return thisData;
  }
  </code></pre>
  
  <p><code>ObjectData</code> is just a structure that contains an array of vertices &amp; an array of indices.</p>
  
  <p>Hope this helps others that may be trying to accomplish something similar.</p>