title: Directx12 Draw rectangle
body: <p>Hi I started to study directx12. I don't have any knowledge on prior versions. </p>
  
  <p>I am following this example program <a href="https://github.com/Microsoft/DirectX-Graphics-Samples/tree/master/Samples/Desktop/D3D12HelloWorld" rel="nofollow">HelloWorldTriangle</a> which rendering a triangle. I want to draw a rectangle  so, </p>
  
  <p>I changed </p>
  
  <pre><code>Vertex triangleVertices[] =
          {
              { { 0.0f, 0.25f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f, 0.0f, 1.0f } },
              { { 0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f, 0.0f, 1.0f } },
              { { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } }
  
          };
  
  m_commandList-&gt;DrawInstanced(3, 1, 0, 0);
  </code></pre>
  
  <p>to </p>
  
  <pre><code>Vertex triangleVertices[] =
              {
                  { { 0.0f, 0.25f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f, 0.0f, 1.0f } },
                  { { 0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f, 0.0f, 1.0f } },
                  { { -0.25f, -0.3f * m_aspectRatio, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } },
                  { { -0.25f, -0.2f * m_aspectRatio, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } },
  
              };
  
      m_commandList-&gt;DrawInstanced(4, 1, 0, 0);
  </code></pre>
  
  <p>But still draws a triangle with different angle .. 
  Please explain what I have to change to get a rectangle. </p>
  
  <p>It will be really helpful for me if you give some links or books to headstart directx12 .. </p>
  
  <p>Thanks in advance .. </p>