GLTF 2.0示例BoxTexture映射问题

时间:2020-06-29 14:36:38

标签: opengl texture-mapping gltf

我解析了样本boxTexture gltf文件并提取了以下数据,

00 : position: -0.5,-0.5,0.5, tex_coords: 6,0,
01 : position: 0.5,-0.5,0.5,  tex_coords: 5,0,
02 : position: -0.5,0.5,0.5,  tex_coords: 6,1,
03 : position: 0.5,0.5,0.5,   tex_coords: 5,1,
04 : position: 0.5,0.5,0.5,   tex_coords: 4,0,
05 : position: 0.5,-0.5,0.5,  tex_coords: 5,0,
06 : position: 0.5,0.5,-0.5,  tex_coords: 4,1,
07 : position: 0.5,-0.5,-0.5, tex_coords: 5,1,
08 : position: -0.5,0.5,0.5,  tex_coords: 2,0,
09 : position: 0.5,0.5,0.5,   tex_coords: 1,0,
10 : position: -0.5,0.5,-0.5, tex_coords: 2,1,
11 : position: 0.5,0.5,-0.5,  tex_coords: 1,1,
12 : position: 0.5,-0.5,0.5,  tex_coords: 3,0,
13 : position: -0.5,-0.5,0.5, tex_coords: 4,0,
14 : position: 0.5,-0.5,-0.5, tex_coords: 3,1,
15 : position: -0.5,-0.5,-0.5,tex_coords: 4,1,
16 : position: -0.5,-0.5,0.5, tex_coords: 3,0,
17 : position: -0.5,0.5,0.5,  tex_coords: 2,0,
18 : position: -0.5,-0.5,-0.5,tex_coords: 3,1,
19 : position: -0.5,0.5,-0.5, tex_coords: 2,1,
20 : position: -0.5,-0.5,-0.5,tex_coords: 0,0,
21 : position: -0.5,0.5,-0.5, tex_coords: 0,1,
22 : position: 0.5,-0.5,-0.5, tex_coords: 1,0,
23 : position: 0.5,0.5,-0.5,  tex_coords: 1,1,

indices:
0,1,2,
3,2,1,
4,5,6,
7,6,5,
8,9,10,
11,10,9,
12,13,14,
15,14,13,
16,17,18,
19,18,17,
20,21,22,
23,22,21,

生成如下所示的opengl模型,

enter image description here

正如您在此处看到的那样,问题在于纹理未正确应用, 这里有什么问题?坐标有问题吗? 我似乎无法查明我到底出了错。

0 个答案:

没有答案