soledad penadés
repeat 4[fd 100 rt 90]

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 ones. So we have the old face and two new ones, and then we assign the appropiate vertexes 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 vertexes! ;)

You came late to the party

Comments are closed, but if you want to comment anything about this entry please let me know using the info in this page.