Hey, for a noob you sure ask tricky questions :P
If you have a bunch of points, represents as (x,y)s, and they're scattered randomly all over your sketch, you can define their distance from the center point as:
dist( x, y, width/2, height/2 );
provided your points are stored in an array, probably most conveniently a Pvector[], you then need to run through the list repeatedly, finding the points with the greatest distance and adding them to your chain, and marking them as checked so the next run finds the next-most-distant point.
First tricky part: how to tell when you've got enough points to encompass all the others I.e. you could run through the loop to select the 100 most distant points, or only 3. 3 points will probably not encompass all the others, and 100 will probably include too many "inner" points. I don't have a quick answer to that, other than testing the shape at each iteration to see if all the other points lie within its borders, which alone is a tricky feat for which most people bring in an outside library like
http://ricardmarxer.com/geomerative/.
Then you have to connect the points you've selected as "outer" points, which is a little easier: make a list of the outer points, pick one to start with, and link it to the point in the list that is closest. Remove both points from the list and continue linking the closest point to the chain until the list is empty, and draw the shape with endShape(CLOSE); to connect to the first point. (I think this would work, anyway.)
Needless to say, it would be a lot easier to write a routine to put random points within a given border. But, what's it for Maybe there is another way to get the effect you're after. Or, maybe there's a really clever way to do what you describe.
--Ben
PS: links from friends:
http://en.wikipedia.org/wiki/Delaunay_triangulationhttp://en.wikipedia.org/wiki/Convex_hullOh, and check out:
http://www.leebyron.com/else/mesh/