Renderer, ...: use PixelRect::GetCenter()
[xcsoar.git] / tools / convplane.pl
blob780b4b331fa5056d15e800a9313167367085bc93
1 #!/usr/bin/perl
3 print "plane\n";
4 drawme("Data/other/plane.txt");
5 print "canopy\n";
6 drawme("Data/other/canopy.txt");
8 sub drawme {
9 my ($file) = @_;
10 open(INFILE,"<$file");
11 my $i=0;
12 while (<INFILE>) {
13 if (/(\S+)\s(\S+)/) {
14 $x[$i] = $1;
15 $y[$i] = $2;
16 $i=$i+1;
19 close INFILE;
20 for ($j=0; $j<$i; $j++) {
21 $xx = $x[$j]-32;
22 $yy = $y[$j]-10;
23 print "{$xx, $yy},\n";
25 for ($j=$i-1; $j>=0; $j--) {
26 $xx = 32-$x[$j];
27 $yy = $y[$j]-10;
28 print "{$xx, $yy},\n";