@MaKiPL
I split quads into two triangles in following way:
i0-i3 - indexes from vertices array
uv0-uv3 - indexes from UV table
Quad Type-A:
{
indices: [i0, i1, i2, i3],
uvs: [uv0, uv1, uv2, uv3]
}
Triangle 1:
{
indices: [i0, i1, i2],
uvs: [uv0, uv1, uv2]
}
Triangle 2:
{
indices: [i1, i2, i3],
uvs: [uv1, uv2, uv3]
}
It work fine for all meshes that use Quad Type-A (didn't find other types yet).
In WebGL (OpenGL ES) you need to have UVs in range [0,1] so after that I needed to divide UVs by texture width/height:
4bit - texture size = 64x64
8bit - texture size = 128x128
16/24bit - texture size = 256x256 (there are no textures in this mode in FF9)
You can get texture mode from tpage value from 0x12 file (I will post this later in separate thread - how to read 0x12 file).
EDIT:
P.S. Nice to see some one from Poland on this forum:)