Home   Help Search Login Register  

Author Topic: Visitor Terrain size Doubler  (Read 4342 times)

0 Members and 1 Guest are viewing this topic.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Visitor Terrain size Doubler
« on: 12 Jan 2008, 11:24:00 »
Updated: Ver 0.76
Very quick and dirty tool to double the resolution of you terrain grid used in Visitor.
Uses the XYZ file format and extrapolates the new points based on the surrounding original vertex points.
Can also be used to produce a 16bit BMP file on either the old or new file.

The main reason I made the tool was to convert my 512x512 wrp grids into better looking 1024x grids to be imported into Visitor.
I haven't idiot-proofed much of the application, so chances are you can overload it with a huge xyz file.
As per all my tools, this is a no-install stand-alone exe file.




« Last Edit: 08 Feb 2008, 14:39:00 by Gnat »

Offline Linker Split

  • Members
  • *
  • BHD MOD leader
    • BHD MOD site
Re: Visitor Terrain size Doubler
« Reply #1 on: 12 Jan 2008, 18:41:01 »
thanks Gnat, an helpful tool!  :clap:
ArmA: Black Hawk Down MOD website
Only the dead have seen the end of war (Plato)

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Visitor Terrain size Doubler
« Reply #2 on: 12 Jan 2008, 21:39:25 »
Nope, doesn't work for me.

I tried it with a small xyz file, representing slightly less than 1.6km X 1.6km.......file size was 17kb.

After loading into this utility it displayed:

Xmax 0
Ymax 0
ZMax: -1000000
ZMin: 1000000
>>> 0 Lines found <<<

File in fact has 675 lines.

Nevertheless, I press on........selecting 'ResizeX2' and then 'Write new XYZ'

New file produced is 11,093kb and has 1,048,576 lines all of which have 0 height.
I was expecting maybe twice as many lines as the old file had.

Tried it also with many other xyz files all different sizes, same thing happens everytime...........0 heights.



Planck
I know a little about a lot, and a lot about a little.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Visitor Terrain size Doubler
« Reply #3 on: 13 Jan 2008, 04:39:05 »
Where did the XYZ file come from Planck ?
Out of Visitor?
Post an example of just a few typical lines and advise if theres any header or footer junk.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Visitor Terrain size Doubler
« Reply #4 on: 13 Jan 2008, 17:39:59 »
Well, the file itself was produced by WrpEdit.

Selecting terrain and saving as a plain text file and giving it an .xyz extension, which is what an XYZ file is basically.

The file has no header and no footer, file also loads into Visitor by choosing to Import XYZ.
Each line is terminated with a Carriage Return and a Line Feed (0D 0A).

Data fields are tab delimited.

First 4 lines:

Code: [Select]
750.00 11100.00 -16.00
800.00 11100.00 -16.00
850.00 11100.00 -16.00
900.00 11100.00 -16.00



Planck
« Last Edit: 13 Jan 2008, 17:43:32 by Planck »
I know a little about a lot, and a lot about a little.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Visitor Terrain size Doubler
« Reply #5 on: 16 Jan 2008, 09:47:25 »
Data fields are tab delimited.

.... read what it says on the first screen about expected format "X[space]Y[space]......."
 

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Visitor Terrain size Doubler
« Reply #6 on: 16 Jan 2008, 16:19:14 »
Ummmm yes.   :-[

Never really paid much attention to that bit, must be getting old.   :P

Edit:

Having edited the xyz file to replace all tabs with spaces I find it still does not work, it complains about 750.00 not being a valid integer value.

Basically unless your X, Y and height values are all integers without any decimal portion it will fail.

More importantly, heights must be an exact integer with no decimal portion or the conversion will fail.


Planck
« Last Edit: 16 Jan 2008, 16:36:45 by Planck »
I know a little about a lot, and a lot about a little.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Visitor Terrain size Doubler
« Reply #7 on: 19 Jan 2008, 11:09:27 »
Oops, your right, that what I get by testing on a limited data set.
Will re-program and post again asap.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Visitor Terrain size Doubler
« Reply #8 on: 28 Jan 2008, 04:35:57 »
............  >:( after being moved again to what I believe will hide it permanently

Mods, about time there was a Visitor or Editors section in these forums.

UPDATE: Link now has Version 0.6
Problem of only handling integer heights removed.

Expected Line Format
INTEGER X[Space]INTEGER Y[Space]REAL/DECIMAL Z[New Line/CR]

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Visitor Terrain size Doubler
« Reply #9 on: 28 Jan 2008, 09:47:29 »
Tools and other resources belong to the Editors Depot boards.
Because it is here where the ED staff picks up the things that finally get to be downloadable in the Editors Depot database..
Addons/mods (this includes islands) belong to the Addons Depot boards.

There was a slight confusions earlier which is why some of the topics in the Addons depot were moved twice.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Visitor Terrain size Doubler
« Reply #10 on: 28 Jan 2008, 20:06:50 »
Thanks for the update Gnat, unfortunately it still doesn't work for me.


I'm using a small .xyz file of 13kb in size
Loading the xyz file goes fine, no problems there, it reports the XMax,YMax,ZMax and ZMin + the number of lines found.

Pressing the 'Resize x2' button produces a popup error requester:
Access violation at address 00444278 in module 'TerrainT.exe'. Write of address 104B1134

Pressing either of the two 'Write BMP' buttons does produce a bmp file but it is completely black when viewed.

Pressing the 'Write new XYZ' button produces a X2Resize.XYZ file which is 17Mb in size and has no data in the height fields apart from 0.000.

Data in the xyz file is space delimited and is in the form:

1100 11750 2.90
1150 11750 12.77
1200 11750 36.54
1250 11750 66.21
1300 11750 90.95
1350 11750 104.79
1400 11750 93.88
1450 11750 75.11
1500 11750 78.10
1550 11750 46.41
1600 11750 17.71
1650 11750 7.83

Trying a second xyz produced from a full size ofp .wrp file.
On trying to load this xyz I get the following error requester.
Access violation at address 004449FC in module 'TerrainT.exe'. Write of address 104D915C.

This file is also space delimited, example:

8900 5500 -9.48
8950 5500 -12.07
9000 5500 -14.11
9050 5500 -15.62
9100 5500 -16.55
9150 5500 -20.25
9200 5500 -22.04
9250 5500 -22.10
9300 5500 -22.17
9350 5500 -22.16
9400 5500 -22.24


Planck
« Last Edit: 28 Jan 2008, 20:10:11 by Planck »
I know a little about a lot, and a lot about a little.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Visitor Terrain size Doubler
« Reply #11 on: 29 Jan 2008, 11:47:03 »
Think I see your problem, your XYZ is not what I (or the program) would expect. The X and Y values do not increase by 1
Where are you getting your files from?
i.e. this is example of expected input (snippets)
Quote
288 277 -50
289 277 -50
290 277 -1
291 277 -1
292 277 0
293 277 4
294 277 14
295 277 21
296 277 25
297 277 36
298 277 42
299 277 42
300 277 46
301 277 37
302 277 29
303 277 20
304 277 9
305 277 10
306 277 8
307 277 10
308 277 10
309 277 10
310 277 10
311 277 10
312 277 10
313 277 -1
314 277 -1
315 277 0
316 277 5
317 277 18
318 277 27

and

Quote
504 277 -50
505 277 -50
506 277 -50
507 277 -50
508 277 -50
509 277 -50
510 277 -50
511 277 -50
0 278 -50
1 278 -50
2 278 -50
3 278 -50
4 278 -50
5 278 -50
6 278 -50

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Visitor Terrain size Doubler
« Reply #12 on: 29 Jan 2008, 16:20:45 »
The X and Y values will indeed increase by 50 at a time, this is because the .wrp files these were taken from have a cell size of 50 metres, this means that each height value is separated from the next by 50 metres so naturally the numbers go up in 50 metre increments.

For a map that had a cell size of 20 metres the values would increase by 20 metres increments of course.

If your X and Y values would increase by only 1, it might mean that each height point is only 1 metre apart from the next.

I might add that these xyz files do load into Visitor.

The values I get when I export the xyz from WrpEdit are always tab delimited, but this is easily changed to make them spaces instead, the actual numbers however are always to 2 decimal places, even though for X and Y the decimal portion is  .00, I stripped the decimal portions of the X and Y values for the attempt at using your utility, otherwise it complains about them not being an integer value of course.


Planck
I know a little about a lot, and a lot about a little.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Visitor Terrain size Doubler
« Reply #13 on: 30 Jan 2008, 11:27:06 »
hmmmm .... should be easy enough to change;
- the X Y not increasing by 1
- Tab delimited
- decimals in the X & Y

But can you supply an actual source file, or even just a 100 lines so I'm sure its a true sample being used by the program.

But still a little confused how a 1x1 grid and a 20x20 grid and a 50x50 grid all work when imported into Visitor.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Visitor Terrain size Doubler
« Reply #14 on: 30 Jan 2008, 16:38:59 »
Surely, Have a whole island.   :cool2:


Planck
I know a little about a lot, and a lot about a little.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: Visitor Terrain size Doubler
« Reply #15 on: 08 Feb 2008, 14:43:59 »
Ok, now updated on the first post to ver 0.76, it can now do your file ... and mine.
Hope its useful.

EDIT: Just a warning, because of the new X & Y reading, its now a bit memory hungry for big maps :cool2:
« Last Edit: 08 Feb 2008, 14:48:00 by Gnat »