How do I draw regular(convex) polyogns

Hi all,

I admit straight off I only got a B in Maths when I left school (something which I regret now that I'm getting into programming... :( ).

I am going through Andre LaMothes Games Gurus book, and am at the point where he gets you to draw random polygons. He then sets a little challenge to see if you can adapt the program to right random REGULR polygons (i.e. non-degenerative) rather than the criss- cross ones that are generated by simple randomised points.

I have no idea how to do it. A friend of mine suggested splitting the Client Area into grids, and then plot random point within these squares - therefore allowing you to "guide" the general flow of the shape. Is this a valid theory? Or is there a better mathematical solution?

Admittedly I have JUST thought of taking a equation for plotting circular points and then adding random elements to each point... any other ideas? Am I on the right track?

Also can anyone recommend a good mathematics book to help boost my skillbase in this regard?
Topic archived. No new replies allowed.