#! /usr/bin/perl
$input = "SAMPLEDATA/Dust%03d.txt";
$output = "POVSEQUENCE/povout%03d.pov";
for ($i = 1; $i <= 10; $i++){
$fin = sprintf($input , $i);
$fout = sprintf($output, $i);
open (IN, "< $fin");
open (OUT, "> $fout");
printf OUT << 'END';
#macro S(p, r)
sphere{
p, r
pigment {
rgbt <1, 1, 1, 0>
}
}
#end
camera {
location <0.5, 0.5, 0.5>
sky <0, 0, 1>
look_at <0, 0, 0>
angle 45
}
light_source{
<2, 3, 5>
color rgb 1.5 * <1, 1, 1>
parallel
point_at <0, 0, 0>
}
END
while ($line = <IN>){
($x, $y, $z, $dummy, $dummy, $dummy, $r)
= split(/\s+/, $line);
printf OUT "S(<$x, $y, $z>, $r)\r\n";
}
close(IN);
close(OUT);
}
|