Tuesday, August 31, 2021

Making Another Triangle...

1 September 2021- Inside Out!

I wanted to try to get the page growing adjacent polygons out to fill the world oval (or 'world peach', becuase the edges wrap around and it has a 'backside', like a peach...). To start with, a triangle! Text wraps around to the left of my 'mapspace'. This triangle is built up from two points and then we push the midpoint to one side for the third point.
(I'd have been better off making yet another triangle fan)

Stuff!

Who were these precursor aliens I mentioned last night? Where did they go and why are the stargates still working? The interstellar travel doubletalk is just an excuse to go somewhere and let aliens come here, but what if the stargates are sentient beings with a desire to ‘Serve Man’ or any sapient lifeform? Why? Again, what happened to their creators? What if their stargates and technology turned against them because they were terrible people, flipping the ‘Skynet’ thing around? We could turn ‘Footfall’ upside down while we’re at it as well.

Forget the FTL and interstellar and go with two alien factions coming to the solar system to involve us in their troubles. Of course, their technology could make it possible, perhaps comparatively easy, to survive and remediate climate change.


Monday, August 30, 2021

So, humans and aliens… why? How? Who are these aliens, what species, how did they get here? Was it FTL or STL? Do they have a ship or did they come some other way? Are they exiles, refugees, dissidents, criminals, terrorists?! (Yes! 8-P)

How about this- our government, or at least the Deep State, has been in communication and negotiating with the aliens for decades. There are secret treaties. There are also alien factions and dissidents or exiles trying to live quietly on Earth.

Interstellar transport is by stargate, and this is a precursor technology which the aliens, who are just a little bit ahead of us, found, figured out, and used. They can’t make them, but the stargates can be damaged or destroyed…


World Grid!

Make a grid of quads from north to south, starting with a polar 'quad'.

Sunday, August 29, 2021

Marching Triangles!

Not much to see here, but I have some marching triangles...

Three Polygons, Finally!

I finally made a all three daughter polygons, and made them clickable, between green and light blue. The initial colors are green, brown and tan for the center poly and the two edge poly. I need to break up the line between the edge polygons, but I'm too lazy to get it done tonight!

I watched Rick and Morty and then anime after midnight instead of writing the code last night and came up with another way to start off the triangle while madly sketching the possibilities. Get a point on the polygon, p0, and the next point, p1, then find a third point across the oval shape, p2. This defines a skinny triangle with a narrow base p0-p1, and we can find a fourth point, p3, at the center of this triangle by averaging the three vertices. We can do this again to get p4 at the center of the triangle (p0, p1, p3), to make a triangle (p0, p1, p4). Or we can find the third point at some randomly generated coordinate inside the oval by rejecting or modifying points which don’t work. We can then check to see if it’s too far and makes an unappealing long narrow triangle, and then reduce that with some more math. Once we have a triangle, we can march triangles around the edge and make a rim polygon. If we get areas and make a polygon until we have a big enough cumulative area, then start another, we can start portioning the area of the world polygon like I had talked about portioning the world surface.

Looking ahead to September and it has thirty days… What if I were to try again? 8-P

What to write about? Who, what, when, where, why and how? Who am I writing about, what is their problem (personal and plot-wise), when and where does the story take place, how can the problem be resolved and why should it be resolved one way or the others?

Obviously I want to write about humans and aliens; I am what I am. What’s the story problem? When and where? How can this end and why? If I’m writing about humans and aliens, what goes very strongly with when and where. What are humans and aliens doing, when and where are they? On Earth? Possibly. Out in the galaxy? (Yes, please!) When does this all happen? Today, last year, a million years from now? If I ever figure these out, I can worry about how and why.


Saturday, August 28, 2021

Mom and I went up to visit Dad’s grave today. Gayle and Jeff were there and Jeff was pleasant. I even tried to say how much I liked the flowers Gayle had just brought… and then she had to improve it, which wasn’t? I didn’t think so. It was a little asymmetric and much better, before. Why make the effort?

Back to the oval-shaped world polygon. We can define a polygon subdivision with a straight line between any two points in the polygon which aren’t adjacent. I’ve done this many times and made a dogleg as well. I was looking at a process of making triangles inside the world polygon from the edges inward. Now, any three consecutive points on the polygon make up a narrow triangle, which we can push inward by subdividing that inner edge. So, pick a point, p0, and the next two points are p1 and p2. Then define a fourth point, p3, on the edge between p1 and p2, then we do some math and find a fifth point inward, p4, to make a triangle fan around p3, quad p0, p1, p4 and p2. The two inner edges can be pushed out inward, although the outer two can wrap around...


Friday, August 27, 2021

Triangle Tiles

Going to lay some map tiles. Click in a tile to add another. We start off with one...

Dynamic text goes here! It wraps around my map.

Jim was telling me that I needed to write more… not sure if that’s because my code is soooo bad, or my writing has any merit. I should get something going here… I worked on the triangles riles thing and actually got some triangle tiles, but it’s still not making me happy.

It’s now the 28th, the second anniversary of my Dad’s death. I need to go up and visit his grave.

Back to triangle tiles. I can splat out three points and make a triangle, feed those points into an array and format them as a polygon for shape-outside and clip-path in CSS. I want those points to be in clockwise order, by finding the leftmost first and then the highest remaining point next. If two points are both ‘leftmost’, the highest comes first. If the two remaining points are highest, the leftmost comes next. These triangles are defined by the vertices, but the edges are implied and open vs. closed edges are important towards building adjacent triangles.


Thursday, August 26, 2021

Better Tiles

Going to lay some map tiles. Click in a tile to add another. We start off with one and we need to click in that one twice to get going.

Dynamic text goes here! It wraps around my map.


I couldn’t make what I was working on last night; I have the page making a new random element (actually paragraph) every time I click inside the oval, but it also creates an element when I click in a new element, because it’s inside the oval; grrr… I need mapspace, which right now is an oval representing a spherical world, with either side of the oval, from pole to pole, is a line of similar coordinates which are actually right next to each other so the world oval wraps around to from left to right edge and right back to left. I imagine this a little like the cleft of a peach, you know, where God split it, just like where God split you, back there between your cheeks…

(Now I may actually find out if anybody ever reads my nonsense!)


Wednesday, August 25, 2021

Triangle Tiles, work in progress

Going to lay some triangle map tiles. Click in the oval to randomly place a green square tile (for now). Click in the tile to remove it.

Dynamic text goes here! It wraps around my map.

I had a nasty power pack fail just as I was heading out this afternoon and I have no idea what I’m headed into tomorrow morning. So there’s that... I’m watching the space weather woman talk about a solar storm which is coming off the sun and straight at us. We don’t know, won’t know what this will mean until tomorrow or friday. There’s no agreement between three different agencies in the US and UK on what will happen, but it might be very bad…

So, back to the triangle tiles. I will start a new page and make a container div called ‘map space’ which I will create and append daughter divs into.


Tuesday, August 24, 2021

I talked about doing an oval world poly grid but what I actually did was revisit the dead simple to do list from a couple of weeks ago, because it helps me understand dynamically created clickable elements better, and I also removed the double-click functionality from my page because that’s wasted on my cell! I hacked a perfectly good work-around, though.

I have a number of experiments which I need to do so that I can use my clickable elements to create and interact with a world map. I can get the mouse position but it is a bit unreliable for this stuff. What I can do is derive a position when I click on an element and then use that to do some math, find the mouse position relative to my element and then move the element around based on that. Thinking about this, I need to splat out a doppelganger of some element I created with the page when I click the mouse, or maybe my mouse is offscreen by default? Hmmm…

I could do a tile-laying game, with triangles or more complex polygons. I can splat out a triangle and push out three ‘petals’ off of the three edges of that triangle. This original triangle is green and we can toggle it between blue and green for sea and land. The petals are tan or grey and when we select them we trigger the page to generate more triangles off of the two open edges and toggle it between green and blue. I can calculate the area of these triangles as I go along.


Better To Do List and more on styling Divs

Updated the simple ToDoList from last week, still based on this guy- link here, who did a great job explaining all of this. Type in a 'To Do' item, enter to add, click on the item to put a line through it when you're done, click again to change the color and one more time to remove.

What I was actually doing was experimenting with creating and modifying divs, and paragraphs, since this was that...

Monday, August 23, 2021

Two of Three Polygons!

Back to picking a random point between p1 and p2 on the world polygon. This is the center of a triangle fan polygon. The quads of a rim around this need to be subdivided where they're too long and I will group them into a pair of rim poly, for a total of three daughter polygons..
I will make all the daughter polygons clickable, between green and light blue.

I can build up an oval world polygon in another way. Start off with the point at the top of the oval, the north pole, and with two points on either side of it. We can make a polar triangle fan by subdividing the triangle naturally made out of three points, based on how wide the ‘base’ is, but at least four. We can build up the points of the world polygon by splicing the left point into the beginning of the list of polygon points and the right point pushed to the end. We can make another row of triangles below the polar triangle fan out of a string of points at the base of the triangle fan and a string of points below between the two sides of the oval world polygon. This bottom, next, line is subdivided into the same number of points and subdivided again if necessary based on distance. We can make all the triangles necessary to subdivide the world polygon, then do some marching triangles to group the triangles into polygons.

Sunday, August 22, 2021

Central Polygon!

Back to picking a random point between p1 and p2 on the world polygon. This is the center of a triangle fan polygon. The quads of a rim around this need to be subdivided where they're too long and I will group them into a pair of rim poly, for a total of three daughter polygons..
I will make all the daughter polygons clickable, between green and light blue.

I’m watching ‘Dismantling The Solar System’ again on SFIA, while I figure out what I can get done before Mom and I go see ‘Jungle Cruise’. I hope that it’s a better movie than I fear it is… Yesterday I messed around and didn’t get much done. I ended up adding points in between other points in the clumsy fashion I had come up with, averaging a random point with an adjacent point. I need to come up with something better! 8-P

And then finally do triangle subdivision of the polygon… unless that’s the way to build that string of points? I have a start point and an ending point which is the other end of the polygon string segment, so that the start point I’m building from is the end point of the polygon string segment and the end point I’m building back to is the original polygon string segment start point, dongma? 8-P

This raises a point indirectly I had been thinking about; the edges of the oval-shaped polygon are a string of points at the back side of the world sphere and struck me this week as sort of the cleavage of a peach… we can very easily subdivide the oval polygon by finding a point within the oval-shaped polygon and connect it in a triangle fan around the circumference of my oval-shaped polygon. This would make a very awkward polyhedron unless we further subdivide the triangle fan, which I intend to do. Now, this means I can animate the march of triangles or quads around the edge of my oval-shaped world polygon, and can subdivide the world into a central polygon triangle fan and two or three rim polygons. The first rim polygon would be more or less a thin version of the sort I’ve been making, the other rim poly being the siblings I have been dragging my feet in creating and saving and the central triangle fan polygon is something old which is new again, so to speak.

I’m working coding on all that, but I just wanted to add that ‘Jungle Cruise’ is a damn good movie, dad jokes and all. Disgusting bad guys, I think that’s what the disclaimer is about, might give the kiddies, or me, nightmares…

I now have a central triangle fan polygon and that’s a new set of points which I haven’t yet saved, to the original set of polygon points or a new set. Each polygon is a string of points and also will be a mesh of triangles or quads (which should be triangle pairs or a four triangle fan). This latter point is essential to creating a decent approximation of the world sphere, so I can get a decent approximation of the area of the triangles in the mesh making up each of my polygons. If I keep the central polygon points separate, that gives me a different set of problems, but it’s probably what I’m going to do. I also probably want to keep cx and cy somewhere… Actually, at some point pseudo-random numbers would be a great idea!


Saturday, August 21, 2021

Slightly Better World Polygon!

Going to improve my polygon and make the sister polygon. First I changed the color on the landmass between brown and green; click in the landmass to see! If you just click in the world polygon, nothing happens.

No words last night. I need to get some more work done on the world polygon. I will make the loop which defines the subdivision of a polygon better, which has more crooks in it as we add points, turning points, even. I want to find the area of each polygon, which means subdividing the polygon into a mesh of triangles, the area of each of which the page can calculate and sum. If a side of one of these triangles if too large then that side should be subdivided, breaking up one long-sided triangle into three triangles with shorter sides. This new point is going to be moved out a bit, making a slightly higher polygon count polyhedron which is slightly closer to a sphere, and the three daughter triangles will be slightly greater in area than the original triangle.

Thursday, August 19, 2021

I have the page making the landmass a clickable element which switches from green to brown. I have the loop which crosses the world polygon subdivided into two points instead of just one. I want to set things up so that we have a series of points from one side to the other, make that polygon and it’s sister, and set the page up so that when you click on a daughter polygon, you will trigger another subdivision. Rinse and repeat as often as desired. Further, I want to subdivide the polygons into a triangle mesh so that I can calculate the area of the polgons.

Better World Polygon!

Going to improve my polygon and make the sister polygon. First I changed the color on the landmass between brown and green; click in the landmass to see! If you just click in the world polygon, nothing happens.

Wednesday, August 18, 2021

Back to work today and I had my parts for a power pack finally, but it’s not what I was building today. That aside, tonight I want to change the color of a clickable element to prove that the user can interact with these dynamic, scriptable DOM elements.

Which I just did, finally, after messing around with an older version of the page and wondering why none of my changes were happening… Now you can click in the world polygon and draw a new world with a red background. You can click on the ‘New World’ button to draw another world with the blue background.

This is all silly stuff, but I am very slowly building up some tools to make my page and the DOM elements interactive. I would like to improve my daughter polygon and draw its sister, make unique daughter polygons clickable so we can subdivide them, etc.


Clickable World Polygon!

I made good on my threat to make the world element clickable... 8-P
Click in the oval-shaped world polygon below to change the background color to red and click again to change it back to blue.
Tired, got that much done, now I need to improve my daughter polygon and make her sister!