title: Basic Primitive - TriangleStrip - Monogame
body: <p>I had a working shape but when I try to change the coordinates it disappears.
  Here is what I did.</p>
  
  <p>This is class level variables:</p>
  
  <pre><code>private BasicEffect _effect;
  private VertexPositionColor[] _vertices = new VertexPositionColor[5];
  </code></pre>
  
  <p>Then in Initialization method I put these:</p>
  
  <pre><code>float aspectRatio = (float)GraphicsDevice.Viewport.Bounds.Width / GraphicsDevice.Viewport.Bounds.Height;
  Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45), aspectRatio, 0.1f, 1000.0f);
  Matrix view = Matrix.CreateLookAt(new Vector3(0, 0, 10), Vector3.Zero, Vector3.Up);
  
  _effect = new BasicEffect(GraphicsDevice);
  _effect.LightingEnabled = false;
  _effect.TextureEnabled = false;
  _effect.VertexColorEnabled = true;
  _effect.Projection = projection;
  _effect.View = view;
  _effect.World = Matrix.Identity;
  
  Color color = Color.Black;
  
  _vertices[0] = new VertexPositionColor(new Vector3(-1, -1, 0), color);
  _vertices[2] = new VertexPositionColor(new Vector3(-1, 1, 0), color);
  _vertices[2] = new VertexPositionColor(new Vector3(1, -1, 0), color);
  _vertices[3] = new VertexPositionColor(new Vector3(1, 1, 0), color);
  </code></pre>
  
  <p>And in draw method I put:</p>
  
  <pre><code>foreach (EffectPass pass in _effect.CurrentTechnique.Passes)
  {
      // Apply the pass
      pass.Apply();
      // Draw the square
      GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, _vertices, 0, 2);
  }
  </code></pre>
  
  <p>This is working fine. but when I change it to this one it doesn't work anymore.</p>
  
  <pre><code>_vertices[1].Position = new Vector3(-0.10f, 1.37f, -3.0f);
  _vertices[0].Position = new Vector3(-0.15f, 1.40f, -3.0f);
  _vertices[2].Position = new Vector3(-0.00f, 1.40f, -3.0f);
  _vertices[4].Position = new Vector3(0.15f, 1.40f, -3.0f);
  _vertices[3].Position = new Vector3(0.10f, 1.37f, -3.0f);
  </code></pre>
  
  <p>another change that i made:</p>
  
  <pre><code>GraphicsDevice.DrawUserPrimitives&lt;VertexPositionColor&gt;(PrimitiveType.TriangleStrip, _vertices, 0, 3);
  </code></pre>
  
  <p>any idea?</p>
  
  <p>Thanks in advance</p>