Friday, July 8, 2022

Today's prompt is 'beach-towel'.


I think I'm going to work on random points and triangles within a map div tonight. A triangle fan around p0, with some area, the sum of the triangles in the triangle fan. Now to get that done...
I still need to find the areas of the triangles in the triangle fan, but I made a start. Later this morning I'd like to push out a triangle fan off of p1 and add on to the area of the blob of land or sea.

Thursday, July 7, 2022

Yet another placeholder...

29 June 2022- Build A World!

I need to create a grid of triangles.

Today’s prompt was ‘seahorse’ and with a little help from google I used a pretty good reference to achieve an excellent sketch, having a fairly good run this week! 8-P



Now I need to work out exactly what I want to code, dongma?!

I have been frittering away time on world-building projects with nothing to show for it and it’s time that I finish something.
The best place for me to start is 2D since I have a 2D medium, the computer screen, and I can use the hated bog-standard rectilinear map or a stereographic projection of a sphere, each heavily distorted in its own way. The map does need to fairly faithfully represent the surface of a world which is near enough to a perfect sphere so as to make no difference for my purposes.
For this I want to make some land and sea blobs modeled on real continents and oceans. Random heights aren't exactly what I want. I want to model the dice drop where TTRPG world builders draw outlines around dice and connect areas around dice which are ‘close enough’. Fake orogeny, mountain generation and rivers up from the sea instead of down. In the past I have drawn maps by hand with free-hand land or sea (or land and sea) blobs, then placed mountain ranges as lines running from one part of the land to another and then rivers from a river mouth on the coast, inland.

I need polygons, especially triangle meshes to draw weirdly shaped divs in my web page (I am still attached to the unholy trinity of HTML/CSS/Javascript which I can (horrors!) code in one HTML file and copy paste into my blog with mixed results. So, a triangle mesh of vertices at or below sea level, with a random point walk of points pulled above sea level. I can make a grid of points within my usual 520 pixels square, say 40 by 40 squares 13 pixels across or use percentages, 100% of a 520 px square div, and then randomize the points, following the edges to get the border of my map div. I can randomly ‘walk’ the points, pulling up land bits and defining the land triangles. The grid makes up quads, which would be subdivided across the short diagonal to make triangle pairs.

Okay, so go do that…


Wednesday, July 6, 2022

Cross product...

29 June 2022- Build A World!

Doing something quick and dirty with the cross product.

Today's prompt is 'octopus'. I googled a nice photo for reference and I'm happy with my work for once.


Back to code...
 

Tuesday, July 5, 2022

Today's prompt was 'starfish'


Now, I need to make most of the stuff I coded in a basic-like block of code into functions...

Point Zero needs to be the center of my world at (0,0,0). P1 should be some point on the surface of the planet relative to P0, the center, and this should be in the Z-positive hemisphere for my sanity. P2 is a similar point, but needs to be closer to P1 than just the other side of the planet. One way to handle that would be to use the longitude and latitude for P1 and use a polar angle and distance to get P2. If I use PI/3 then P1 is at some polar angle and ⅓ PI and then P2 is somewhere from the north (or Z-positive, anyway) pole to ⅔ PI. We can then use this and the cross product to find a 4th point, P3, the 3rd vertex of the triangle, based on the distance between P1 to P2.

This gives me an initial triangle and an initial shape to use for my world div. I need to keep track of the points in wrdv and use them to rewrite the world div shp as I need to.


Monday, July 4, 2022

Eh, I made a triangle

29 June 2022- Build A World!

I'm going to make some triangle faces of a polyhedron which approximates the surface of my world sphere, starting with two vectors between three points in the surface of the sphere which represents some patch of land or sea.