L3DT users' community
Large 3D terrain generator

xyz export problems

Any and all chit-chat regarding L3DT.

xyz export problems

Postby seafire6 » Tue Mar 23, 2010 12:33 am

I've been trying to get my L3DT created terrains into VBS2 Visitor4 program in the xyz format without success. The imported terrains are completely flat and under water. When I open the L3dt created terrain in xyz file format in notepad it doesn't appear in the needed 2x format. Instead of being 20480x20480; it is instead 20470x20470. A 10240x10240 map opened in notepad is 10230x 10230. Could this be the problem? The terrain image imported as a .png file goes over ok ie 10240x10240.
seafire6
Member
 
Posts: 18
Joined: Mon Mar 30, 2009 1:32 am

Postby Aaron » Tue Mar 23, 2010 9:22 pm

Hi Seafire,

The imported terrains are completely flat and under water.


It sounds like the coordinate system you have in VBS2 Visitor4 has incorrect scaling (particularly, the Z axis). The X/Y/Z coordinates in the files are all measured in metres, without any differential scaling.

Instead of being 20480x20480; it is instead 20470x20470. A 10240x10240 map opened in notepad is 10230x 10230. Could this be the problem?


No, those coordinates are correct.

If you count through the coordinates of 2048 points, starting with the first one at 0, the 2048th point will be at 2047. For example, consider a 3x3 heightfield. The coordinates along the x-axis will go from (0,0) to (1,0) to (2,0). The third and final coordinate is (2,0). Similarly, in your XYZ file, the 2048th and final coordinate is (2047,0).

If you want coordinates stretching to a position of 2048, then you need a 2049x2049 pixel heightmap. You can achieve this using the 'resize for export' checkbox in the export wizard.

Regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby seafire6 » Wed Mar 24, 2010 12:30 am

Thank you, Ill give it a try.
seafire6
Member
 
Posts: 18
Joined: Mon Mar 30, 2009 1:32 am

Postby ALuomala » Mon Jan 10, 2011 5:34 pm

Rather than start a new post dealing with the same issue (more or less), I will ask here:

I am also using VBS2, and the proprietary terrain editing software package, Visitor4. The ability within V4 to modify terrain is very poor, and I decided to try out your program, and while I love it (the ability to change the elevation, dynamically, in 3D with L3DT puts your program head and shoulders above the limited ability that V4 provides (3D editing is available, however it is slower than molasses, and the only real method to modify the ground is via lassoing vertices, and manually entering values, or using dropdown windows that allow for averaging, min/max height, manual height input, and some smoothing), I am having the same basic issue as Seafire6: upon importing the terrain into L3DT (I first export from V4 into GlobalMapper, via ASC format, and then export from GM into L3DT (HFZ/HF2 format), the heightfield doesn't seem to be the correct size anymore. I understand your explanation of how the units are measured, and perhaps someone at BohemiaInteractive doesn't (i.e their method of exporting the correct values is wrong), but it does cause problems upon working on a terrain heightfield in L3DT (and then exporting it back into V4).

The problem is this: there is always a -99999 meter border around my heightfield. I suspect that this is due to a invalid value in the 0,0 (or perhaps 4097,4097??) position (I am basing this on using a 4096 x 4096 heightmap, of course). I have had some success in the past with using your "Resize to: " whilst exporting, but if I forget that step (which I have done in the past :oops: ), I end up with major issues once I export it back into GM -> Visitor4.

I suppose those of that utilize L3DT for use in VBS2 (and I have also trumpeted the value of L3DT to my colleagues within the VBS2 world, but a lot of them are constrained by government procurement issues :evil: from using "unauthorized" software, and many are hesitant (even if they could use it) due to the mitigating factor of having to do a number of additional steps: exporting ASC terrain, importing into GM, exporting in correct format (perhaps I am doing something wrong, but I use HFZ/HF2 format as it was the only one that seemed to work when I initially starting mucking around, and I haven't experimented otherwise), and then modifying the terrain with the brushes, exporting (and remembering to either re-size or cropping (which I have done, but I always wonder if I am doing it correctly.....), and so forth....) would like is a more "one-stop shopping" workflow, whereby we could simply export a terrain from Visitor4 (XYZ seems to be a common enough format), work on it in L3DT, and export back into V4, without having to crop or re-size. Is this feasible??? I would like to hope so, as I would like to use L3DT more than I have, but I have had enough issues (due to incorrect sizing, and huge drop off's created by the invalid values) to cause me to approach using it with hesitation (especially when working close to a deadline, as forgetting one step can cause a huge knock on effect, if the problem isn't noticed right away, and it gets "embedded" into the final product (I had a few issues, entirely my fault, where I was smoothing along the edge of the terrain, and unbeknownst to me, I had smoothed down to the -99999m value, causing an enormous hole to be created in my terrain).

Sorry for the lengthy post, but I hope the gist is simple enough: a means of maintaining the original terrain heightfield size throughout the process.

Thanks for your time on this, Aaron, it is greatly appreciated.

Allan
User avatar
ALuomala
Member
 
Posts: 18
Joined: Fri Dec 03, 2010 2:03 pm

Postby ALuomala » Tue Jan 11, 2011 1:04 pm

After thinking this through over lunch, I think I figured out a work-flow for using L3DT with the VBS2 tools:

1) Export terrain heightfield from V4 (either ASC or XYZ format).

2) Import into GlobalMapper (GM).

3) Export as BT (seems to give better resolution than other formats that L3DT can import), or whichever format works.

4) Import heightfield into L3DT

5) Do neccesary adjustments in L3DT.

6) Export -> Export Map (Heightfield), select format (BT, HF2/HFZ, etc (or XYZ if XYZ exporter is downloaded, which would eliminate the need for step #7)). Ensure that "Resize for Export" is checked, and add 1 to the X and Y values of your heightfield values (4097,4097 for a 4096x4096 map, so example).

7) (Skip this step if you exported XYZ format in step #6) - Import map into GM, then export as ASC or XYZ format

8) Import map into V4.

Note: I tried the XYZ export out of L3DT and tried to import that directly into V4, and I received an error. Not sure if that is an issue on my end, or due to the format.

Hopefully this helps someone using the VBS2 terrain tools.

Allan
User avatar
ALuomala
Member
 
Posts: 18
Joined: Fri Dec 03, 2010 2:03 pm

Re: xyz export problems

Postby Aaron » Fri Jan 14, 2011 7:28 am

Hi ALuomala,

I tried the XYZ export out of L3DT and tried to import that directly into V4, and I received an error.


Can I ask you to send me a small example file of the XYZ and/or ASC formats from V4? (to aaron@bundysoft.com, zipped please) Assuming V4 correctly imports what it exports, these files will help me understand what V4 expects.

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia


Return to General discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron