-1

The problem is that JSONCPP has a bug. It does not read JSON file properly. We store 3D models in JSON and today we got a model that crash our app.

In short if we load that JSON (120KB) and save it new file we get 80KB. All vertexes are missing but normals, tangents, etc is still in file.

Please, recommend C++ JSON parser that is similar to JSONCPP as much as possible.

Upgrading JSONCPP does not help.

4

2 回答 2

3

您使用的 JSON 无效。查看第 1389 到 1392 行。

                 [ -0.5321721434593201, 0.0, 0.8466361761093140 ],
                 [ -0.5321721434593201, 0.0, 0.8466361761093140 ],
                 [ -0.5321721434593201, 0.0, 0.8466361761093140 ],
                 [ -0.5321721434593201, 0.0, 0.8466361761093140 ],
                 [ -1.#IND00000000000, -1.#IND00000000000, -1.#IND00000000000 ],
                 [ -1.#IND00000000000, -1.#IND00000000000, -1.#IND00000000000 ],
                 [ -1.#IND00000000000, -1.#IND00000000000, -1.#IND00000000000 ],
                 [ -1.#IND00000000000, -1.#IND00000000000, -1.#IND00000000000 ],
                 [ -0.5321709513664246, 0.0, -0.8466369509696960 ],
                 [ -0.5321709513664246, 0.0, -0.8466369509696960 ],
                 [ -0.5321710109710693, 0.0, -0.8466369509696960 ],
                 [ -0.5321710109710693, 0.0, -0.8466369509696960 ],
于 2013-09-19T16:14:20.417 回答
0

试试cJSON,它是 ANSI C 中一个很好的超轻量级 JSON 解析器。我们将它们用于复杂数据交易的商业部署。我猜3D模型会归结为复杂的数据,你可以试一试。

于 2013-09-19T16:25:23.667 回答