PnP TerrainCreator - Forum

The PnP TerrainCreator Forum
It is currently Thu Sep 21, 2017 1:26 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Importing .raw from Unity
PostPosted: Fri Nov 06, 2009 12:31 am 
Offline

Joined: Tue Aug 04, 2009 3:53 am
Posts: 15
Hi,

I'm trying to import a 16bit raw heightmap exported from the unity3d tool (http://unity3d.com/).
However I'm struggling to find the right settings to get it imported. I've tried playing with the height, but I end up with huge pillars instead of the nice islands.

This is the heightmap: http://www.xordan.com/terrain.raw

It should look something like this:

Image

Any idea what settings to use?


Top
 Profile  
 
 Post subject: Re: Importing .raw from Unity
PostPosted: Tue Nov 10, 2009 5:51 pm 
Offline
Programmierdochfix
User avatar

Joined: Tue Apr 27, 2004 12:53 pm
Posts: 891
Location: Braunschweig
Hi, there is no way for me to obtain the true parameters from this raw file.
However, the file stores numbers in the range from 0 to 33956, so it doesn't use the full range of values in a 16 bit file format. That's why I think these values correspond to some real heights, maybe centimeters or maybe tenth of inches.

To import this raw file, you should first create a terrain with only one sector, a sector size of 512x512, and a detail element size of 1. Now import your raw file using the whole terrain import functionality. Use the following settings: Format=WORD (2 Byte), Offset=0, Factor=0.002. Simply use the default values in the following dialog "select import area".

So in order to get a precise scaling factor I need to know the unit/measurement system used within the program that exported the raw file. Furthermore, the horizontal distance between heightmap elements (or the border size of the sector) should also be known if you want to achieve a precise import. Can you give me this information?


Top
 Profile  
 
 Post subject: Re: Importing .raw from Unity
PostPosted: Mon Nov 16, 2009 1:42 am 
Offline

Joined: Tue Aug 04, 2009 3:53 am
Posts: 15
Hi,

Thanks for that. I can import it roughly right now :)

As for more details.. I don't think I can get a whole lot from the program. What I do know is:

Image


Top
 Profile  
 
 Post subject: Re: Importing .raw from Unity
PostPosted: Mon Nov 16, 2009 10:00 am 
Offline
Programmierdochfix
User avatar

Joined: Tue Apr 27, 2004 12:53 pm
Posts: 891
Location: Braunschweig
Ok, lets assume the terrain dimensions (width, length, and height) are given in meters, which seems to be a suitable assumption given the picture above.

Then the "Detail element size" to be set in the terrain properties dialog of PnP can be computed as follows: 2000 / (513-1) = 3.90625.
Use this value and a "Sector detail size" of 512 as used above.

Now, I think the height of 600 meters is mapped to the full range of available values of a 2 byte (16 bit) integer, which is the value of 65535.
So the result of 65535 / 600 = 0.009155 is the correct scale factor to be used for importing the terrain.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron