tesselation problem

Started by
2 comments, last by iMalc 19 years, 6 months ago
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
_____ /____ /|| | || MtY | ||_____|/Marty
Advertisement
Maybe instead, put a new vertex in the middle of a triangle face. Then you'll have 3 triangles instead of one.
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.
Keys to success: Ability, ambition and opportunity.
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.
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms

This topic is closed to new replies.

Advertisement