L3DT users' community
Large 3D terrain generator

XYZ Import?

It doesn't hurt to ask...

XYZ Import?

Postby stormridersp » Sat Dec 18, 2010 8:16 pm

I wonder if it is possible to import a XYZ heightmap into L3DT?
I've tried the XYZ plugin but it can only export.
stormridersp
New member
 
Posts: 5
Joined: Sun Oct 17, 2010 4:56 pm

Postby Aaron » Sun Dec 19, 2010 6:09 am

Hi stormridersp,

L3DT does not support terrain mesh imports in any format. To load such terrain in L3DT, you first have to rasterise the mesh data into a heightfield. This can be done in various 3rd party programs such as Blender.

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

Postby Gnat » Thu Jan 13, 2011 11:36 am

Hi Aaron,
First off, big thanks for this great software.

Second, as you might have guessed your getting a lot of hits from ArmAII and VBS2 people (ie users of the basic "Visitor" terrain making editor) who are looking for easier ways to create interesting & realistic terrain in Visitor and hence into ArmAII or VBS2 (both simulators has same 3d engine heritage).

So, in our terrain creation pipeline is the step of "Importing XYZ" into L3DT;
If L3DT can export the simple format, is it so hard to import XYZ?
Are we talking different file formats?
The format is very simple
Starts with X and Y with 3rd parameter as height.

Sample Sequence of 1024x1024 heightmap.
Code: Select all
0 0 -50
1 0 -50
2 0 -50
3 0 -50
4 0 -50
5 0 -50
6 0 -50
7 0 -50
8 0 -50
9 0 -50
10 0 -50
11 0 -50
...
...
...
1017 0 -50
1018 0 -50
1019 0 -50
1020 0 -50
1021 0 -50
1022 0 -50
1023 0 -25
0 1 -50
1 1 -50
2 1 -30
3 1 -30
4 1 -30
5 1 -30
6 1 -30
...
...
...
551 103 24
552 103 20
553 103 20
554 103 16
555 103 15
556 103 18
557 103 18
558 103 22
559 103 16
...
...
...
1012 1023 -25
1013 1023 -25
1014 1023 -25
1015 1023 -25
1016 1023 -25
1017 1023 -25
1018 1023 -25
1019 1023 -25
1020 1023 -25
1021 1023 -25
1022 1023 -25
1023 1023 -25
Gnat
ArmAII Terrain Maker & cat herder
Perth, WA
User avatar
Gnat
New member
 
Posts: 2
Joined: Tue Jan 11, 2011 4:18 pm

Re: XYZ Import?

Postby Aaron » Fri Jan 14, 2011 5:08 am

Hi Gnat,

Right you are. I confused the XYZ format as being a mesh rather than an arbitrary point list without faces.

The updated XYZ plugin is available here [EDIT: Now included in installer; see next post].

Please note that this update requires L3DT Pro v2.9 build 4 or later, which is currently only available in the Professional flavour, and is on the downloads page now. If you are using the Standard Edition, please let me know and I will compile an installer for L3DT Standard v2.9 build 4.

Please also note that for these changes to take effect, you must re-load the plugin using the extension manager. Merely copying the file over the old plugin isn't enough this time (reason: re-loading the plugin resets the flag that indicates the XYZ format can be loaded.)

Gnat wrote:If L3DT can export the simple format, is it so hard to import XYZ?


I wouldn't say "so hard", but in general it is harder to load files than save them. In this case,the exporter is ~130 lines of code, whilst the the importer is ~300. The difference is due to the fact that XYZ files don't have a header that states the map size (in pixels) or the horizontal scale, and hence I had to write a two-pass loader to guess these values. The method of guessing is correct for any files exported from L3DT, but may be in error for files exported by other programs (depending on their formatting or other quirks). I've added ample sanity-checks on the inputs just to be safe.

If you have any trouble with the plugin, please let me know.

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

Re: XYZ Import?

Postby Aaron » Sat Jan 15, 2011 12:40 am

Hello again,

I've included the XYZ importer/exporter with the installer for L3DT as of v2.9 developmental build 5 (15th of Jan 2011), which is on the downloads page now in all flavours (Standard, Pro and Torque).

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

Re: XYZ Import?

Postby Gnat » Sat Jan 15, 2011 6:52 am

Thanks very much aaron.
I'll try testing this weekend.
Cheers.
Gnat
ArmAII Terrain Maker & cat herder
Perth, WA
User avatar
Gnat
New member
 
Posts: 2
Joined: Tue Jan 11, 2011 4:18 pm


Return to Feature requests

Who is online

Users browsing this forum: No registered users and 3 guests

cron