🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

X file Format FVF Data can Conversion to UV coordinate?

Started by
1 comment, last by Aressera 2 years, 5 months ago

Hello. I am a developer who is upgrading the engine version from dx9 to DX11. I am using an x ​​file as a 3d model format, and in dx9, I directly loaded it using d3dx api, but in d3d11 there is no way to do that, so I am using the assimp library. Here is the problem. I know that multiple texcoords are supported in x file, the first one loads well, but the second one is stored in fvfData and the assimp library does not read fvfData when reading x file. It is a situation in which the device does not load properly. Therefore, the second texcoord is trying to modify the library code to read fvf, but how can I replace the data in fvfData with UV coordinates of float type?

fvfData{

258,

2444;

1058666458,

1025861520,

1058666458,

999485440,

}

Except for 258 and 2444 in the text format above, the bottom 4 lines seem to indicate texcoord1 of vertex 0 and texcoord1 of vertex 1, respectively. When I check the values ​​using d3dx viewer, these values ​​are texcoord1(0.601438, 0.040382) It comes out as texcoord1(0.601438, 0.004484). I don't know how the hell is that value converted to uv value, so I ask here. Is there a formula to convert fvfData to uv coordinates? Please help me!

Advertisement

Try reading the values as uint32_t, then reinterpret_cast them to float. For instance, 1058666458 is 0.601438.

This topic is closed to new replies.

Advertisement