   Mesh from point soup
  Hi everyone,I want to support multi level water in my game. So, water going from a hill downwards to a lake, for example.My idea is to generate a separate mesh for this which I place in the "carved path" in the terrain. Then I can turn off Z-Buffer checks, and use a nice height/waterlevel diff shader to smoothly blend the edges. (Currently doing this, it works alright)But! my problem is that I'm clueless how to generate a mesh from an arbitrary amount of points. I want to use a texture for the water planes. I can then easily lookup the height of the terrain at that point from the heightmap.I tried a convex hull generator (stanhull), but this is more of a bounding box of my vertices. It works nice, though. But for this purpose, unusuable I'm afraid.Now, as far as I know, I cannot use a simple ID3DXMESH which I fill up with arbitrary points either?So, I'm wondering if anyone has interesting ideas/suggestions or atleast a keyword to search on. It's not called "tessellation" as far as I know.PS: I don't think a simple trianglelist-heightmap algorithm works out, because of the irregular nature of the mesh. Unless I'm mistaken. Guess I will give that a try now.Many thanks in advance.   
  One technique I've seen is to define the mesh points in the terrain building tool.  You just surround bodies of water with linked points and construct the "water" mesh from those points.  Downside is that it needs to be done on every map manually.I'm sure you could think of a niftier pre-processing step to run on your map.  Maybe you just have to "paint" rivers and lakes as bodies of water then you can do some calculations to figure out water levels and such.-me   ;  What you have is known as a "point cloud". Generating a mesh from it is a tricky process, and there are a variety of libraries out there (most non-free). Searching for "point cloud" instead of "point soup", though, will find most of them.   ;  Thanks! I will have a look. Hope to find a free one.I guess I could generate a mesh somehow from a small pointlist myself. The main issue is that I like to have it made from a texture, so I can have a nice random map generator :).;  Okay. How about this:- Create a "Water map" texture. Anything not black is water.- I divide this the same way as my quad tree. Increases render calls, but allows me to determine where there is water and where not, saving a lot of pixel tests (since I can't use the zbuffer because a lack of terrain precision)- Use Delaunay triangulation on these blocks. Now we will have a 2D mesh.- Probably Simplify / Optimize, or subdivide.- Then, use the heightmap to determine the actual height of the vertices, change the y component of the vertices.- Done.- I can use the water map to blend the borders of the water as well.I guess that might just work. It probably even works with my already implemented StanHull thing, unless I'm completely forgetting something because of the late time :). It sounds... too easy. :);  i think a widespread algo for construction surface from point clouds is the marching cubes algo. but i think it's patented but i'm not sure. If it is, there's still marching oktaeder i think.i think i'm thinking a alot...regards,m4gnus   