メッシュ用の配列としてvector二次元配列を用意して1頂点ごとに設定したいのですがどうすればいいのでしょうか?一様知っている範囲で調べながら型を設定しましたがemplace_back(1,1,1,1,1,1);と入力できません。とりえず固定配列にしました。
std::vector<std::vector<float>> vec;//メッシュ
bool Game::Initialization(HDC dc) { //デバイスコンテキストを作成 mDeviceContext = dc; //メッシュ int mesh[][8] = { {-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} }; //インデックス int idx[][3] = { {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} }; return true; }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。