title: Directx Vertex Color
body: <p>code is here as requested:</p>
  
  <pre><code>void MakeTeapotRed()
  {
      D3DXCreateTeapot(Device, &amp;Teapot, 0);
  }
  </code></pre>
  
  <p>so how do I change the vertex color of the teapot? If your thinking material, i already know that, I just need to know the color vertex which is supposed to be a much simpler thing than material. I can do this with a geometry mannually layed out with Vertex Buffers and Index Buffers, how do you apply this to a mesh with those VB and IB info filled out already? </p>
  
  <pre><code>class ColorVertex
  {
  public:
  ColorVertex(){}
  ColorVertex(float x, float y, float z, D3DCOLOR color)
  {
      m_x = x;
      m_y = y;
      m_z = z;
      m_color = color;
  }
  float m_x, m_y, m_z;            // 3d coordinates
  D3DCOLOR m_color;
  static const DWORD FVF;
  };
  const DWORD ColorVertex::FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE;
  </code></pre>
  
  <p>The code I just posted is the class for the Vertex information called ColorVertex. As you can see, the code is setup for vertex color, color that doesnt required or must NOT have a light to work properly, as shown in FVF = D3DFVF_XYZ | <b>D3DFVF_DIFFUSE</b>. <br/></p>
  
  <p>Again, people seems to have a hard time understanding the problem, I need to update the color of the vertex to include color, for objects like teapot, sphere, mesh that can be created through D3DCreate[objects] eg. D3DCreateTeapot(arguments stuff). 
  Pls layout the code line by line, I'm a noob in directx, not in c++.</p>