Monday, December 27, 2021

I haven't been drawing my sketches but I will get one done tomorrow. For tonight, I just want to get a page taking user inputs through mouse clicks to draw some 'marching triangles'. I have an offset div for a button which lets the user define that XY offset for the page by clicking the div. This is because I can't seem to predict what that offset will be in advance, so I have to see where the offset div actually is in the page by getting XY when the div is clicked. This is not terribly precise but better than nothing, and I expect that I should be able to correct the offset over time, maybe? 8-P

After the page has an XY offset, the offset div is transformed into a 520 by 520 px map space div. The user clicks on a point inside this div to select a starting point for their map-making. The page then takes this origin and generates a complete circular triangle fan (four or more, probably five triangles) around this point, of clickable triangle divs. The user clicks on one of these triangles to use as the start point and the page generates any adjacent triangles which don’t exist yet. In the case of the clickable triangle div in this circular triangle fan we have two neighbors in the circular triangle fan and an open outer edge. We push out the two endpoints of this edge, making an arc of triangles (and the missing adjacent triangle) around the one endpoint and then another arc around the other endpoint. Each triangle has three adjacent triangles to go to next and which would be clickable so that we can pick one and move on to it. We want as many clickable divs as we have initial triangles in the circular triangle fan (again, probably four or five), then we will redefine our clickable divs to use them as we need to. When we move, the current triangle div can be clicked again to change something about it, probably toggling between land and sea, but two of the former adjacent divs will be reassigned to two current adjacent divs. This gives us a small number of constantly reassigned clickable divs, if I figure out how to make this work.


No comments:

Post a Comment