Tuesday, September 14, 2021

I was thinking about blocking out the world terrain with rectangles, again… start by picking twop points in the world rectangle which is a square 100% wide and tall as far as shape outside is concerned, for making polygons, in this case a quad. We can pretty easily turn this quad into a pair of triangles or a triangle fan and also push the vertices of the quad-polygon around and/or subdivide the daughter triangles! I’m not doing this right now, I want to recursively subdivide the world rectangle! (Or maybe I am?)

The first rectangle has two opposite corners defining the four vertices and subdivides the outer parent world rectangle into that rectangle plus eight other rectangles. If one vertex is at the corner of the world rectangle, we only really get four, with five nonexistent ones with zero area. We can use a loop to create these daughter quads or rectangles, and recursively replace quads as we make daughter quads inside of them.

This is pretty silly; I want to get to the world oval polygon/world peach polyhedron as painlessly as possible and we can do subdivision of these nine quads into two polar triangle fans from the quads squished down on one side into triangles and the three equatorial quads into twelve daughter triangles in three quad derived triangle fans. This leaves me with five triangle fans which I can use to make some landmass or seas, and piecing together adjacent similar triangles.

We can move the vertices around and randomly set the heights so that the vertices are above or below water and therefore land or sea. This means we can get two poles and six vertices in between, which we can randomly jitter around, up, down, left right and in and out (altitude). For the immediate projection of some sort of world map we can average the vertex heights to get land or sea.

I realize now that I’ve been over this with the world polygon to world peach polyhedron already… leave the poles alone and make an initial polar triangle fan from three or more points along some latitude, then put together a triangle strip below that, repeating until we get down to the south pole. So I need a list of points with px, py for longitude and latitude and XYZ for the cartesian coords of the low poly world peach polyhedron, starting with the north pole and ending with the south pole, plus all the points in between spliced in between. These vertices get really complicated really quickly but to start with I need px, py and a randomly derived altitude so that we can tell if a world tile is on average above or below sea level. I can make these triangular tiles from left to right in each row, stitched together down the seam at the back of my world peach polyhedron, building them out of vertices and averaging those vertex altitudes to see if it’s land or sea. I can think of a way to randomly weight these altitudes above or sea level.


No comments:

Post a Comment