lib3ds によって解析されたファイルから頂点を取得しようとしていますが、多くの問題が発生しています。つまり、私は出ていた頂点を取得していません。これを実行しようとするコードは次のとおりです。
//loop through meshes
for(int i = 0; i < model->meshes_size; i++)
{
Lib3dsMesh* mesh = model->meshes[i];
//loop through the faces in that mesh
for(int j = 0; j < model->meshes[i]->nfaces; j++)
{
int testv = mesh->nvertices;
Lib3dsFace face = mesh->faces[i];
//loop through the vertices in each face
for(int k = 0; k < 3; k++)
{
myVertices[index] = model->meshes[i]->faces[j].index[0];
myVertices[index + 1] = model->meshes[i]->faces[j].index[1];
myVertices[index + 2] = model->meshes[i]->faces[j].index[2];
index += 3;
}
}
}
残念ながら、lib3ds のドキュメントは存在しないため、これを理解することはできません。このライブラリを使用して頂点の配列を取得するにはどうすればよいですか? また、3ds が古いことは認識していますが、フォーマットとライブラリのセットアップ方法は私の目的に合っているため、別のフォーマットに切り替えることは提案しないでください。