Sign in to follow this  
Marty666

tesselation problem

Recommended Posts

Hi all, I'm done rendering a sphere. The idear is to heightmap it. I start off with a octahedron (if thats what 2 piramids, one upsidedown is called). Then I added some noise to the vertexes. I tesselate the edges to make 4 triangles out of every existing one and add some more noise to the newly created vertexes. This goes on a couple of times untill im satisfied with the amount of detail. The problem is that there are holes in my sphere. It lies in the tesselation, cause for every triangle the edges are split. So every edge is split twice. How do i avoid this? I can look up the edge if it was allready split, but it would take years to do that. I could also not for every triangle split the edges, bus for every edge. Then I would have a problem creating the right triangles and have them all front facing. Are there any good tutorials about this tesselation problem or can anyone give a solution? Thanx! Marty

Share this post


Link to post
Share on other sites
Just split all your edges first. If you jumped all over processing the edges as you would going through the faces then who knows where the other half went. If you process them in order from start to end you know exactly where the other half is. If you had n edges when you started then you have 2n when you are done. If the original edge was m then one half is m and the other half is m+n. Once you do that then process the faces to create the other half of the new edges plus the new faces.

Share this post


Link to post
Share on other sites
I have come across the same problem as you. Basically the thing you said would take years to do worked fine for me. I don't think there is a much better solution. I ended up doing this in realtime with quite acceptable results, but ideally you should only do it once on initialisation.

petewood: putting a new vertex in the centre of the triangle is not the correct way to do it, and will not give a properly tesselated square when you tesselate the second time, I believe.

It's far better and more correct to split along each edge. I suggest doing that, and also don't start with an octahedron, start with a dodecahedron as it comes out better IMHO. All triangles are then equilateral I think. I mean if you're doing it at initialisation time you may as well generate the best looking sphere.

The front facing part is easy, use the outwards pointing normals. Actually my code generated the correct winding also if I remember correctly.

I can give more details if you like, feel free to PM me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this