title: OpenGL C++ Plain Subdivison in QUADS (Radiosity) patches on arrays
body: <p>I am trying to implement Radiosity in OpenGL for my project. Firstly, I need to be able to draw a plane (representing walls). And then be able to subdivide that plane into patches or smaller quads within that plane by using a method.</p>
  
  <p>The difficulty is to draw them in a way when I draw another plain (another wall) if the height and width aren't the same the vertices are not aligned creating T vertices which I want to avoid.</p>
  
  <p>I was thinking in something like</p>
  
  <pre><code>void drawPlaneMethod(float width, float height, int numberOfSubDivisions) {}
  </code></pre>
  
  <p>However I might need to use ratios or something related. I don't care about the Z-axis coordinate as I can rotate my planes after they are constructed. The number of sub-division on height and width must be proportional to the other wall.</p>
  
  <p>If this is not possible, then I can do that by using planes of the same height and width, however it looks unrealistic as I end up a heigh ceiling. And I can't make windows, doors without having to carefully creating many planes to represent a single wall.</p>
  
  <p>Then I gotta face another problem that is to be able to store information on each patch such as colour, radiosity values etc. I was thinking of using arrays of objects (Patches) and representing the planes indexes to access the patches objects. As I am not very good with c++ I am finding it hard to use arrays of any sort (2 dimensional arrays would be ideal I guess).</p>
  
  <p>Any insight on this problem?</p>
  
  <p>PS: I am using glBegin(GL_QUADS), I can change later on for VBOs once I do the basics of my project.</p>