Closed native-engine closed 4 months ago
My guess would be that you're not using the English locale; cgltf uses stdlib functions like strtod for parsing, which are locale sensitive. Normally the locale would default to C but maybe something in your application is setting it to system; using setlocale(LC_ALL, "C");
before calling cgltf_parse could fix this.
Thank you very much!
When importing models from a glb file, properties cgltf_float of class cgltf_accessor such as 0.9999997019767761 and 0.9999993443489075 are parsed as 0, and -0.9999990463256836 as -0:
I already wrote to Khronos developers about why their plugin exports 1 and -1 values from Blender 3D so incorrectly, but they replied that this is a flaw in the JSON parser, not in their plugin.
I'm attaching some of my code:
and the textual analog of its glb file: model.gltf.json.
P.S. Parser TinyGLTF exports all numeric values correctly, but: https://github.com/syoyo/tinygltf/issues/483...