increased vertex data precision to match blender exports

This commit is contained in:
unknown 2024-11-15 19:47:28 +01:00
parent 7c5d74e98e
commit 7d460474c1

View File

@ -1969,17 +1969,17 @@ bool ExportMesh(Mesh mesh, const char *fileName)
for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 3) for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 3)
{ {
byteCount += sprintf(txtData + byteCount, "v %.2f %.2f %.2f\n", mesh.vertices[v], mesh.vertices[v + 1], mesh.vertices[v + 2]); byteCount += sprintf(txtData + byteCount, "v %.6f %.6f %.6f\n", mesh.vertices[v], mesh.vertices[v + 1], mesh.vertices[v + 2]);
} }
for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 2) for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 2)
{ {
byteCount += sprintf(txtData + byteCount, "vt %.3f %.3f\n", mesh.texcoords[v], mesh.texcoords[v + 1]); byteCount += sprintf(txtData + byteCount, "vt %.6f %.6f\n", mesh.texcoords[v], mesh.texcoords[v + 1]);
} }
for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 3) for (int i = 0, v = 0; i < mesh.vertexCount; i++, v += 3)
{ {
byteCount += sprintf(txtData + byteCount, "vn %.3f %.3f %.3f\n", mesh.normals[v], mesh.normals[v + 1], mesh.normals[v + 2]); byteCount += sprintf(txtData + byteCount, "vn %.4f %.4f %.4f\n", mesh.normals[v], mesh.normals[v + 1], mesh.normals[v + 2]);
} }
if (mesh.indices != NULL) if (mesh.indices != NULL)