Modcraft - The community dedicated to quality WoW modding!

Projects => Software Development => Topic started by: sigmur on October 17, 2015, 10:14:07 am

Title: [QUESTION:WotlK] ADT MH2O - how to manage the uvmap
Post by: sigmur on October 17, 2015, 10:14:07 am
Hi, i made a little tool to set water on an adt.

As of now, everything i expected works fine, you can set liquid & liquid type chunk by chunk, define the subchunks where you want to set liquids and even specify the height of your liquid to make non planes rivers, like the waterfals in the grizzly hills and set liquid transparency.

There is still one thins i do not manage with this, it's the UV map.

According to http://www.pxr.dk/wowdev/wiki/index.php ... Depth_data (http://www.pxr.dk/wowdev/wiki/index.php?title=ADT/v18#Case_0.2C_Height_and_Depth_data" onclick="window.open(this.href);return false;)

In some case, the chunks can have an uv map, defined like so :

struct uv_map_entry {
  uint16_t x;
  uint16_t y;
};

I found it using 010 editor, and it match the description, an uv map is a set of two coordinates, u and v, to place a 2d texture on a 3d object.

But i do not see how uint16 can be used for the job. I've joined the 010 template updated with the right water structures since it wasn't mine in the first place.
Title: Re: [QUESTION:WotlK] ADT MH2O - how to manage the uvmap
Post by: Ascathos on October 17, 2015, 04:21:24 pm
I think uint16 match the actual px position, but I might be wrong. Probably need schlumpf or cromon, however, others might also be able to help.
Title: Re: [QUESTION:WotlK] ADT MH2O - how to manage the uvmap
Post by: schlumpf on October 17, 2015, 05:03:36 pm
How could they not be used? A uint16_t is a value. you need two values. you have two values. The wiki states that you need to divide them by 8 before using, which you should obviously do as floats to not lose data.
Title: Re: [QUESTION:WotlK] ADT MH2O - how to manage the uvmap
Post by: sigmur on October 17, 2015, 05:11:57 pm
Ok ty that's exactly what i wanted to know.