Let's assume for a second i knew which object are in the back, even then, how do i need to draw this? I've added my code.
use GD;
use constant PI => 4 * atan2(1, 1);
$im = new GD::Image(400,400);
$black = $im->colorAllocate(0,0,0);
$red=$im->colorAllocate(255,0,0);
$green=$im->colorAllocate(0,255,0);
$im->filledEllipse(200,200,50,50,$red);
$im->filledEllipse(300,200,25,25,$green);
for($xy=0;$xy<6.28;$xy+=0.01){
$x = 100*cos($xy);
$y = (43.75/2)*sin($xy);
push @punten,[200+$x,200+$y];
}
$data =$im->gifanimbegin(1,0);
$data.=$im->gifanimadd(1,0,0,1);
for($z=0;$z<=$#punten;$z+=20){
$ima = new GD::Image(400,400);
$black = $ima->colorAllocate(0,0,0);
$red=$ima->colorAllocate(255,0,0);
$green=$ima->colorAllocate(0,255,0);
$ima->filledEllipse(200,200,50,50,$red);
$xc = $punten[$z][0];
$yc = $punten[$z][1];
$ima->filledEllipse($xc,$yc,25,25,$green);
$data.= $ima->gifanimadd(1,0,0,1);
}
$data.=$ima->gifanimend;
binmode STDOUT;
print $data;
|