L3DT users' community
Large 3D terrain generator

Attribute Map exported properties

Got a problem or need advice?

Attribute Map exported properties

Postby cliff » Sat Oct 07, 2006 5:53 pm

Hi, there.

I'm working on a tool for the Neverwinter Nights 2 toolset that does terrains. Unfortunately, it doesn't just allow the importing of a texture file - instead you have to paint your textures using the textures that the game ships with.

My problem is this - I am having trouble making heads or tails of how the *_AM.png file relates to the climatic values. The color values I see in the png when I load it are nothing at all like the color values I see in the *.cli.xml file, nor can I wrap my head around how to translate the color value into the ID# listed in the exported type info list that the application generates.

Any help you guys could give would be most appreciated.
-----
If the truth can be told...
So as to be understood...
It will be... believed.
cliff
Member
 
Posts: 14
Joined: Sat Oct 07, 2006 5:40 pm

Re: Attribute Map exported properties

Postby Aaron » Sun Oct 08, 2006 3:50 pm

Hi Cliff,

Welcome to the users' group.

The colours in the *_AM.png files, when read as unsigned short integers (16-bit), are the same as the ID#s in the export list. If you want to see the attributes map in the full-colour mode, you might like to follow this part of the user guide:

http://www.bundysoft.com/docs/doku.php?id=l3dt:userguide:ops:am#editing_the_attributes_map

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

Postby cliff » Sun Oct 08, 2006 9:00 pm

Wonderful, thank you.
-----
If the truth can be told...
So as to be understood...
It will be... believed.
cliff
Member
 
Posts: 14
Joined: Sat Oct 07, 2006 5:40 pm

Postby cliff » Mon Oct 09, 2006 1:38 am

I've gotten it working pretty well, and I have a small followup question. What does a value of 1.0F in Vertical Scale represent in metres? Is there a value somewhere that this is representing a percentage of?
-----
If the truth can be told...
So as to be understood...
It will be... believed.
cliff
Member
 
Posts: 14
Joined: Sat Oct 07, 2006 5:40 pm

Postby Aaron » Mon Oct 09, 2006 2:48 am

Hi Cliff,

Cliff wrote:What does a value of 1.0F in Vertical Scale represent in metres? Is there a value somewhere that this is representing a percentage of?


Um...that depends on the 'Vertical Scale' to which you refer (there may be several). From whence do you find this 'Vertical Scale' value?

Anyway, I'll take a stab that this is in some file input/output, which is where I generally do my 'vert scale' tricks to convert from file values to metres. For instance, loading a 16-bit HFF file will have a vertical scale of:

Code: Select all
scale = (maxval - minval) / 65536;


Where scale, minval and maxval are all in metres.

For an 8-bit file, it is:

Code: Select all
scale = (maxval - minval) / 256;


To convert form file values to metres, we use:

Code: Select all
height = fileval * scale;


I hope this helps.

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

Postby cliff » Mon Oct 09, 2006 3:33 am

Yeah, I've got the vertical scale (which is a small fraction) and the height values stored in the HFF. The Vertical Scale float from the data format is coming out as a rather small value... is this a proportion of a maximum value from somewhere?

Perhaps I am missing values in a different file... but while I have the general height value as a proportion from 0 to 1, I do not know what the resultant height should actually be in metres.
-----
If the truth can be told...
So as to be understood...
It will be... believed.
cliff
Member
 
Posts: 14
Joined: Sat Oct 07, 2006 5:40 pm

Postby Aaron » Mon Oct 09, 2006 3:55 am

Hi Cliff,

Okay, if you're referring to the HFF the relevant scale info is on the HFF specs page. That page explains how to convert from file values to metres using the vert scale and vert offset (see the reading/writing a HFF sections), and also has source code for loading a HFF.

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

Postby cliff » Mon Oct 09, 2006 4:18 am

Ah, I think I must've failed to understand what I was looking at, since that's exactly where I was digging. I think I've found it now, thanks again for all your help!
-----
If the truth can be told...
So as to be understood...
It will be... believed.
cliff
Member
 
Posts: 14
Joined: Sat Oct 07, 2006 5:40 pm


Return to Help and support

Who is online

Users browsing this forum: No registered users and 13 guests