再实验了一下,建立一个4个顶点的模型,来创建一个sprite3D就不会出问题。
按理说,sprite2D也是4个顶点构成的结构,看来还是2者的shader不一样导致的,或许可以考虑提供一个sprite的3D版本来解决这个问题吧
“meshes”:
{
“attributes”: {
“size”: 3,
“type”: “GL_FLOAT”,
“attribute”: “VERTEX_ATTRIB_POSITION”
}, {
“size”: 3,
“type”: “GL_FLOAT”,
“attribute”: “VERTEX_ATTRIB_NORMAL”
}, {
“size”: 2,
“type”: “GL_FLOAT”,
“attribute”: “VERTEX_ATTRIB_TEX_COORD”
}],
“vertices”:
100.000000, -100.000000, 0.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000,
-100.000000, -100.000000, 0.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000,
100.000000, 100.000000, 0.000000, 0.000000, 0.000000, -1.000000, 0.000000, 1.000000,
-100.000000, 100.000000, 0.000000, 0.000000, 0.000000, -1.000000, 1.000000, 1.000000
],
“parts”:
{
“id”: “shape1_part1”,
“type”: “TRIANGLES”,
“indices”:
0, 1, 2, 1, 3, 2
]
}
]
}