Improving mesh subdivision

Well, I have found the mysterious bug that we always have when we code something. The mesh subdivision algorithm is recursive, as you could imagine viewing the images. In each pass, it divides each face in three more faces. So we have the old face and two new ones, and then we assign the appropriate vertices to each face. In the next iteration we have to subdivide too the faces we had created previously, but I had forgotten to change the maximumFaces index, so it didn't divide properly. As you can see in the next images, I have fixed it!! :-)

Mesh subdivision with 2 passes mesh subdivision 2 passes (fixed)

Mesh subdivision with 3 passes mesh subdivision 3 passes (fixed)

Mesh subdivision with 5 passes mesh subdivision 5 passes (fixed)

Next step is playing with the vertices! ;)