Sunday, June 13, 2021

Triangles and meshes, bones and skin!

My triangle object is TR4 because I want to put the three corners or vertices (P2D or P3D for XYZ, and P5D for XYZ and corresponding longitude and latitude of a UV sphere) of the default definition of a triangle in the object, although a triangle can be represented by the three sides or edges (EJZ or LNZ) which in turn are defined by two endpoints or two endpoints and a midpoint, but I also want to derive the triangle center, the average of the three corners, because I want to use the average Z coordinate to sort my triangles from far to near, drawing near triangles overlapping far triangles. I can go whole hog and just put everything I could possibly need in my triangles, points, edges (so we can find neighbors), centers, area, surface normal, etc (TR9). I will want the at least TR7 to handle corners, sides and centers to create a decent triangle mesh where individual triangles are ‘aware’ of their neighbors, useful for drawing landmass with some sort of random walker, doing airflow, temperature and precipitation, things to which I aspire even if I consistently fall short.

My peep object is a simple list of triangles at this point (actually it’s not currently an object per se, but a list of points, the left and right foot, and a destination; I’ll probably be getting back to the octahedral mesh I had going last month eventually) but it needs to use control points so that assemblies of triangles which represent limbs can be modified, moved and shaped. I want to make ‘bones’ which move and cover them in a ‘skin’ or mesh which moves with the bones. I have already done something like this, but it was a cludge (like everything else I code! 8-), and I want a helpful utility of some sort. It will continually rebuild or at least modify the ‘bones’ and mesh.

Body shape and bones of a peep goeth thus; we already know where the feet are, a body center at the midpoint between and above the two feet and a facing or ‘fronting’. So we can place hips on either side of the center of mass and a head some distance in front of and above the center of mass, plus a tail of course somewhere behind the center of mass, and then two two shoulders for the wings. Two leg bones, head or neck bone with a head on the end of the neck, tail bone and two wind bones, or at least what I call the wing ‘butt’ when I’m talking about some fried chicken… I can pull on the vertices of a lopsided octahedron, or octahedral polyhedron after we subdivide the eight faces four or six ways, or more (less, three way subdivision, would be kind of pointless), or pull out a new point from the hip to the ground and use the vector to pull out four more points around that to make a triangle cone or pyramid, the 3D version of the 2D sort of thing I’ve been mucking about with in serpentine landmass. Do the same sort of thing for the neck, wings and tail, or make octahedrons instead, two triangle cones or pyramids base to base, but I want to concentrate on the bones of each leg first, hip to knee to ankle to the ball of the foot and chicken claw. A chicken leg is obviously something with at least three joints, but so is your human leg, just not so obvious…  personally, I find myself sliding my feet along these days and almost tripping two or three times a day. A chicken is picking them up and putting them down more like a prancing pony! 8-P


No comments:

Post a Comment