Tuesday, September 28, 2021

I have the tools I need to make clickable divs in the page and what I want is to be able to select points within my world div to make into land or sea. I can do this by establishing a world div for my ‘canvas’ which will be shaped into a near oval polygon by the user picking points; the more points, the closer the polygon approximates an oval, or my ‘world peach polyhedron’ approximates a sphere… The first point will give us a ‘latitude’, which will give us a point on the right and left edges of the world div polygon, which is one point down the seam at the back of my world peach, and this will give us a point inside of a quad triangle fan, although in fact this is a pair of double-sided triangle faces in 3D. We can subdivide the polar triangle fans along the midpoint and turn this into a lopsided octahedron. With a second point we can derive a central quad triangle pair between the north and south poles, plus what we can make off the two matching points at the seam. This would also make a lopsided octahedron, with a pair of three polar triangle fans. With a third point we can define a central triangle, plus two adjacent triangles to the north and south pole respectively. This gives us three edge points at the seam and we get another pair of three polar triangle fans, the central triangle and also make five more triangles touching the seam, making a dodecahedron, a twelve-sided polyhedron. This is the ‘simplest’ instance I’m comfortable with for now; a pair of points works and even a single point can be made to work!

I want to pick points and pick heights; pick the point first, then instead of going on to the next point we can add up dx and dy to get a ‘height’. A negative height is below sea level and a positive height is above sea level. I can mark that with a red or black div or even a div with a bit of text, in red or black. The rest of the points, at the poles and the seam, will all average to zero or sea level, unless we want a button to change that… We will then want to subdivide the resulting triangles along sea level if possible. If the triangle vertices are at or above sea level, then that is land, below or at sea level is sea and if any of the vertices are positive while one or more is negative, then we need to subdivide the triangle and probably some adjacent triangles need to be subdivided as well.


No comments:

Post a Comment