Saturday, September 18, 2021

I think that I was supposed to follow that up with something, but I guess I just didn’t feel like it…

Anyways, I didn’t fill an oval with triangle strips either and now I want to go back to build out some polygons, silly old fat man! 8-P I was thinking about dot and cross products; cross lets me find clockwise and get the area of a triangle, it’s the magnitude of the vector, which is just the z component for 2D but it’s just a little bit more complicated in 3D. I can and do want to know clockwise for my 3D polyhedron faces so I can draw the ones we can see! And areas, of course. What was dancing through my head was visions of triangles marching around a point to complete a triangle fan, then we made triangle fans around the outer vertices; P0 is the center of the initial triangle fan and P1 is the center of the next triangle fan. We want all the triangles around any given point, then we make a smaller triangle fan polygon inside with the midpoints of the triangles, instead of subdividing the triangles six ways and grouping them. The ‘polygons’ are actually triangle fans with new vertices which need to be pushed out to the surface of the sphere which we’re approximating and the area of the polygon is the sum of all these areas.

This second triangle fan starts at P2, runs to P0 and then to the last point, clockwise, in the initial triangle fan. We then find some more points clockwise around P1 until we get back to P2, then we do the same thing for P2. Each triangle belongs to three points, but each point is shared by a number of triangles.

I know how to make singleton triangle fans, I am working on a way to build triangle fans from existing triangles and not have them overlap. I want to use the cross product to find the vectors to the left or clockwise of the initial triangle and pair of vectors and the vectors which are to the right of the initial counterclockwise vector, vector A to vector B shall we say, get spliced into the beginning of a list of triangles and vector pairs. Talk about a paralyzing data structure problem!

Triangles are three point indices in clockwise order, each vertex goes in a list of points. Each triangle fan is a list of triangle indices, point indices and vectors in clockwise order. I build overlapping polygons with the triangle fan list of points indices, but I make the second, smaller, list of inner triangle fan vertices by averaging the vertices of the triangles and we could get away with duplication but let’s not, let’s find existing new vertex points or make a new if it doesn’t exist yet.


No comments:

Post a Comment