Saturday, December 4, 2021

I talked to Greg about my map making stuff and I need to finish something, so it might be a great idea to talk it through-

  1. Make an initial triangle from a vector. We get a vector from two points in our (2D) map space, one after the other  and push out the third point of the triangle to the left of this vector.

  2. With a triangle we now have three vertices and three edges. We can push out an edge to the left, outside, of the triangle, making one triangle, or a corner vertex, making a pair of triangles. If an edge of one of the triangles in a pair is too short, collapse down to one triangle filling in a concavity. If it’s too long, subdivide the triangle into a pair of triangles. We decide whether to push out a point or an edge at random.

  3. We are building a triangle mesh inside of the polygon and a perimeter outside of the polygon. The list of perimeter points are used to push out vertices or edges, making new triangles to add to the mesh and adding to or removing points from the perimeter.

  4. We increase the polygon until we have enough triangles in the mesh, then we start a new polygon, adding triangles to the new triangle until we have enough of them, changing the color, from green for land to blue for water.

No comments:

Post a Comment