Hi all!
I'm trying to implement the Doo&Sabin recursive subdivison algorithm as an assignement but I've some problems.
The mesh data comes as a shared list of vertices and a list of faces storing pointers for its vertices.
What I'm doing is:
- Calculate the new vertex position to create each face-face.
- Look at each pair of vertices in each face (what would be an edge) and check if a edge-face was created previously, if it's not done I look at each face of the model looking for the same pair of vertices but reversed (the edge should be in the opposite direction) and create a face with these two pairs.
And the problem comes because I don't know how to create the vertex-face. I'm thinking of using a list to store which vertices derive from an original vertex but I don't know how to choose the right order to create a well oriented polygon.
I've searched some examples and haven't found anything, in some places they say the most efficient way of doing subdivision is using the half-edge data structure but even using it, I don't know how to create the vertex-faces.
Anyone can help??
I'm trying to implement the Doo&Sabin recursive subdivison algorithm as an assignement but I've some problems.
The mesh data comes as a shared list of vertices and a list of faces storing pointers for its vertices.
What I'm doing is:
- Calculate the new vertex position to create each face-face.
- Look at each pair of vertices in each face (what would be an edge) and check if a edge-face was created previously, if it's not done I look at each face of the model looking for the same pair of vertices but reversed (the edge should be in the opposite direction) and create a face with these two pairs.
And the problem comes because I don't know how to create the vertex-face. I'm thinking of using a list to store which vertices derive from an original vertex but I don't know how to choose the right order to create a well oriented polygon.
I've searched some examples and haven't found anything, in some places they say the most efficient way of doing subdivision is using the half-edge data structure but even using it, I don't know how to create the vertex-faces.
Anyone can help??