print "File root: "; $f = ; chomp $f; $file = "$f.inc"; $outfile = ">$f.obj"; $N=0; $T=0; open(IN, $file) or die "Can't open $file $!\n"; open(OUT, $outfile) or die "Can't open $outfile $!\n"; print "Processing...\n"; # pass 1 - identify the points while ($line = ) { chomp $line; if ($line =~ "triangle") { $T+=1; ($P1,$P2,$P3) = split (">",$line); $P = $P1; Point(); $P = $P2; Point(); $P = $P3; Point(); #; } } $NN=$T*3; print "$T triangles = $NN sides, $N points\n"; close (IN); # pass 2 - identify the faces open(IN, $file) or die "Can't open $file $!\n"; print "Writing...\n"; while ($line = ) { chomp $line; if ($line =~ "triangle") { ($P1,$P2,$P3) = split (">",$line); $P1 =~ s/.* "; $P = $x . " " . $y . " " . $z; #print "$P\n"; #} print OUT "v $P\n"; } #print "\n"; }