found the 'drawStar' function below from stack overflow user licson, made this script draw random stars... is this more of what you need?
Edit: sorry, misread what you said.... this draws stars. still a good function though, lol. How do you plan to determine the boundaries, or the dynamics of each polygon?
// function grabbed from user "licson" on stackoverflow.com
function drawStar($img,$x,$y,$radius,$sides,$color,$spikness=0.5)
{
$point =array();
$t = 0;
for($a = 0;$a <= 360;$a += 360/($sides*2))
{
$t++;
if($t % 2 == 0)
{
$point[] = $x + ($radius * $spikness) * cos(deg2rad($a));
$point[] = $y + ($radius * $spikness) * sin(deg2rad($a));
}else{
$point[] = $x + $radius * cos(deg2rad($a));
$point[] = $y + $radius * sin(deg2rad($a));
}
}
return imagefilledpolygon($img,$point,$sides*2,$color);
}
$im = imagecreate(500, 500);
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
for($i=0; $i<10; $i++)
{
drawStar($im, rand(0,500), rand(0,500), rand(20,50), rand(5, , $white);
}
// output image to browser
header('Content-Type: image/jpeg');
imagejpeg($im,"",100);
// destroy the image
imagedestroy($source);
imagedestroy($im);