Win32 Perl Users, I got it working

F4Browse, CATE, Tacedit, Terrainview & TheaterMaker etc utility related

Moderators: Lone Wolf, Snake Man

Guest

Win32 Perl Users, I got it working

Post by Guest » 2000-10-02 19:07:00

Snake Man was so nice that got he made my l2 and o2 files. But I wanted a way to make more and use Julian Onions scripts in Windows, since I don't have Linux, and still got those strage results while making the l2 and o2 files. That bluish color on the groung and pink in the water. SO I stated reading this forum and found this.

Dogman said that

"so the getaltitude routine should be:

sub getaltitude {
my($alt);
$alt = unpack("s", $_[0]);
$alt *= 3.280840; # convert metres to feet
return $alt;
}

I hope that is what you were looking for.

Doogman"

So I changed the getaltitud part and voila! it worked. Everything came out as it should. For those who don't know how to edit the script I'm willing to send the windows modified script.

FalconPR out

Guest

Re: Win32 Perl Users, I got it working

Post by Guest » 2000-10-03 14:37:00

Can you tell us the procedure of how to get working WINDOWS perl setup?

which perl to download, how to run the script etc etc.

PMC TFW
Snake Man

Guest

Re: Win32 Perl Users, I got it working

Post by Guest » 2000-10-03 22:06:00

OK

To make dem2lf.pl work on windows

It seems that the script gives wrong altitude data in windows, that's why the *.l2 file comes out wierd looking in Terrainview.

First I'm using ActivePerl 5.6 for Windows

Following Dogman's tip I did the following:

*Use Wordpad to edit it*

I changed the Sub getaltitud instructions from:

sub getaltitude {
my($alt);
if ($byteswap) { # motorola format
$alt = unpack("s", pack("n", unpack("v",$_[0])));
}
else { # intel (native)
$alt = unpack("s", $_[0]);
}
$alt *= 3.280840; # convert metres to feet
return $alt;
}


To the following:

sub getaltitude {
my($alt);
$alt = unpack("s", $_[0]);
$alt *= 3.280840; # convert metres to feet
return $alt;
}

And to run it just go to
Run in the start menu
and type

x:\dir\dem2lf.pl -2 yourDEM.bin anyname

where "x:\dir" is the Directory where the script is, "yourDEM" is the name the DEM file has, and "anyname" is the name you want the l2 and o2 file to have.

Remember that the DEM bin file has to be in the same directory as the script.

FalconPR out

Who is online

Users browsing this forum: ClaudeBot [Bot] and 0 guests