Sunday, August 1, 2021

Stitching up some polygons...

I vegged out today and did nothing at all. I need to get my words in and post something, then get to bed... I want to use requestAnimationFrame() to march some triangles through my map, and then march some random triangles to pick landmass. How do I handle this? I know how I split up a grid of squares, rectangles, quads or pixels. I can randomly subdivide some latitude and longitude quads into triangle pairs, top left and bottom right or top right and bottom left. Top triangles will be defunct in the top row and bottom triangles will be defunct in the bottom row.

I don’t want that, so I need to figure out something else. That something else is I have the page create a polygon in the form of a triangle fan around the north and another around the south pole. I then have the page create polygons between these two north and south polar polygons. I can pick a random point on the northern polygon and randomly walk a dogleg down to the southern polygon, follow that around the southern polygon a few points and then back up to the northern polygon. This stitches up a third polygon and by default defines a fourth polygon. I need to go see if I can make this work...


No comments:

Post a Comment