When you have a point cloud and want to obtain the shape, you can use the convex hull or the alpha shape algorithm. In the computational geometry library I am using in my projects, CGAL, these algorithms are built-in, but they have a disadvantage: the points are not output in the correct order. I first tried to solve this problem by implementing a convex hull algorithm myself that outputs the points in the correct order, but this did not always help since it ignored concave corners. Therefore I wrote my own algorithm to replace it. My algorithm divides the rectangular area of the given cluster into four triangles and computes the points belonging to the outer border of each triangle. Thus it also includes concave corners. Imagine this to be the rectangle: -------- |\ /| | \ A/ | | C\/ | | /\D | | /B \ | |/ \| -------- If it is a square, we can assume that its sides have a length of 2a. The coordinates of the mid point are always (0, 0). Th...
Sol writes on Pouet : About a couple decades back I wrote a graphics/game programming tutorial based on SDL 1.2. It used to be a major driver of traffic to my site, so one or two of you may have come across it. Time has passed and because of the old SDL (and old compiler suites) the tutorial has been more or less obsolete. I've started to revamp it - not completely rewrite, as it still uses much of the old material (as basics don't really change). I'm basing it on SDL3, so it should be relevant for a while again. Well, as relevant as plotting pixels goes. As of this writing the first 10 chapters are here: solhsa.com/gp2/index.html Go check it out!
Comments
Post a Comment