BZSCRAP.ORG SUPPLIED README DOWNLOAD: transofrmHGT 1.2 CREATOR: DivisionByZero RELEASE THREAD: http://www.battlezone1.org/resize-and-reposition-hgts-with-transformhgt-t4482.html ======== If you've ever started working on a map but realized the map size you chose was to small, this is the tool for you! With it, you can take any HGT file and - make a copy that's bigger or smaller. - make a copy who's contents have been shifted left, right, forward, backward, up, or down. - find the highest and lowest points. transformHGT is a command line utility, so you need to know how to use the command prompt to use it properly. This tool was programed in Java so you run it slightly differently than you would tools like makeTRN. To use this tool, you just open up the command prompt, change the current directory to transformHGT.jar's directory, and type: java -jar transformHGT.jar If you leave blank or type something invalid, it will display help text. You always have to pass in an HGT file. After all, it can't resize or reposition an HGT file if there is no HGT file to work with. Unfortunately, HGT files don't describe there own width and depth, so you have to give transformHGT those values yourself. java -jar transformHGT.jar myFile.HGT /W=2 /D=2 In this case we're referring to the file myFile.HGT and we're saying it's width and depth are both two 'chunks'. When we define an HGT file's width and depth in transformHGT, we define it in chunks, whereas in makeTRN, you do so in meters. A chunk is made up of 128x128 vertices, and each orthogonally adjacent pair of vertices with the same height are 10 meters apart. Now, what if we wanted to resize this file to be 3x3 chunks large instead? All we have to do is specify the file we want to write to, and what we want the dimensions to be! java -jar transformHGT.jar myFile.HGT /W=2 /D=2 bigFile.HGT /w=3 /d=3 Here we use a capitol 'W' and 'D' for myFile.HGT's width and height, and a lowercase 'w' and 'd' for bigFile.HGT's width and height. bigFile.HGT doesn't have to exist beforehand, as transformHGT will just create a new one by that name. Also, note that it doesn't matter what order you put the flags in: java -jar transformHGT.jar myFile.HGT bigFile.HGT /W=2 /D=2 /w=3 /d=3 This will work just as well, just make sure you remember to put the file you want to read before the file you want to write. If you run either of the two commands above, it will read myFile.HGT, and eventually write to bigFile.HGT. When it's done with that, bigFile.HGT will contain all of myFile.HGT's height data, but will be bigger. At this point you just have to modify the TRN's Width and Depth properties accordingly. TRNs stores that data in meters, so you will have to multiply the new HGT's width and depth by 1280 to get the numbers to put into the TRN. One problem: everything is in the bottom left corner of the map! There is no space between what was in the original HGT and the left of the map, but there is tons of space on the right! And it's the same for the front and back of the map. How do we fix this? We can reposition the height data within the map like so: java -jar transformHGT.jar myFile.HGT /W=2 /D=2 bigFile.HGT /w=3 /d=3 /x=64 /z=64 Note the two new flags /x and /z. These let you assign an x-offset and a z-offset, which allows you to move everything left, right, forward, and backwards by some number of vertices. In our case, we have a 2x2 area of content within a map 1 chunk larger right and forward, and we want it centered. Each chunk is made up of 128x128 vertices, so we move the 'content area' right 128/2 vertices (/x=64) and forward 128/2 vertices (/z=64), that way there's 64 vertices between the left and right side of the 'content area' and the map, and the same for the front and back. One more problem: the height of every vertex outside the 'content area' is all the way down to zero. Luckily, transformHGT has a fix for this, too. java -jar transformHGT.jar myFile.HGT /W=2 /D=2 bigFile.HGT /w=3 /d=3 /x=64 /z=64 /u=5000 Now there's the /u flag. This tells transformHGT what to set the height of all vertices outside the 'content area' to. In our case, its 5000, which is equivalent to 500 meters. What if we didn't care about resizing myFile.HGT, but instead wanted to raise or lower the height of every vertex on the map? In that case, we'd want to use the /h flag. java -jar transformHGT.jar myFile.HGT /W=2 /D=2 /h=-150 The /h flag, like /u, is in tenths of meters, so we are actually lowering the map by 15 meters. One useful feature is the /i flag, which finds and displays the highest and lowest points on the map. java -jar transformHGT.jar myFile.HGT /W=2 /D=2 /i Don't forget to modify the TRN if you change the HGT's size! If some of the northern chunks are missing, you may have to reduce the TRN's MinZ property. This tool does not change the positions of objects in the BZN, the way the MAT maps textures to the terrain, or the way the LGT applies shadows. You will have to modify those separately. If you have any questions, feel free to ask below. If you find any bugs, let me know and I will try to fix them as soon as possible. (Edit: fixed a bug causing a runtime exception when you try to reposition the map)