title: Generating vertices programmatically
body: <p>I have a 3D object (<code>SCNPlane</code>) i want to divide this plane into squares.   Idea is to divide the plane into tiles and each tile has its own textures (texture coordinates).  And the number of tiles is controlled by user interface.</p>
  
  <p><a href="https://i.stack.imgur.com/dtjbq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dtjbq.png" alt="enter image description here"></a></p>
  
  <p>In the above image the plane is divided into 3 tile along x axis and 3 tile along y axis and each tile is further divided into two triangles.  Right now i am trying to use the for loops to generate these vertices.  I am new to this metal/opengl world if anyone can point me in the right direction it would be great.</p>
  
  <p>Thanks</p>