提示コードの最後の行ですがなぜかここで提示画像のエラーが出てしまいますこれはどうしたらいいのでしょうか?構文エラーではないです。
質問2 ですが単純に**「 .jsonファイルを読み込んで "vertices" 部の配列の数値をint[] に入れたい 」**という処理を作りたいです
これをするにはどうすればいいのでしょうか?
参考サイト: https://www.qoosky.io/techs/5bc254637c
公式サイト: http://rapidjson.org/index.html
#include <iostream> #include "rapidjson/include/rapidjson/document.h" typedef char* CharType; int main() { std::string json = "Assets/Cube.json"; rapidjson::Document d; d.Parse(json.c_str()); rapidjson::Value& s = d["vertices"]; return 0; }
"version":1, "vertexformat":"PosNormTex", "shader":"BasicMesh", "textures":[ "Assets/Cube.png" ], "specularPower":100.0, "vertices":[ [-0.5,-0.5,-0.5,0,0,-1,0,0], [0.5,-0.5,-0.5,0,0,-1,1,0], [-0.5,0.5,-0.5,0,0,-1,0,-1], [0.5,0.5,-0.5,0,0,-1,1,-1], [-0.5,0.5,0.5,0,1,0,0,-1], [0.5,0.5,0.5,0,1,0,1,-1], [-0.5,-0.5,0.5,0,0,1,0,0], [0.5,-0.5,0.5,0,0,1,1,0], [-0.5,0.5,-0.5,0,0,-1,0,-1], [0.5,-0.5,-0.5,0,0,-1,1,0], [-0.5,0.5,-0.5,0,1,0,0,-1], [0.5,0.5,-0.5,0,1,0,1,-1], [-0.5,0.5,0.5,0,1,0,0,-1], [-0.5,0.5,0.5,0,0,1,0,-1], [0.5,0.5,0.5,0,0,1,1,-1], [-0.5,-0.5,0.5,0,0,1,0,0], [-0.5,-0.5,0.5,0,-1,0,0,0], [0.5,-0.5,0.5,0,-1,0,1,0], [-0.5,-0.5,-0.5,0,-1,0,0,0], [0.5,-0.5,-0.5,0,-1,0,1,0], [0.5,-0.5,-0.5,1,0,0,1,0], [0.5,-0.5,0.5,1,0,0,1,0], [0.5,0.5,-0.5,1,0,0,1,-1], [0.5,0.5,0.5,1,0,0,1,-1], [-0.5,-0.5,0.5,-1,0,0,0,0], [-0.5,-0.5,-0.5,-1,0,0,0,0], [-0.5,0.5,0.5,-1,0,0,0,-1], [-0.5,0.5,-0.5,-1,0,0,0,-1] ], "indices":[ [2,1,0], [3,9,8], [4,11,10], [5,11,12], [6,14,13], [7,14,15], [18,17,16], [19,17,18], [22,21,20], [23,21,22], [26,25,24], [27,25,26] ] }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。