MayaのapiMeshShapeプラグインでメッシュデータ構造を変更するように求められます。そこで、 openglを使用して( en.wikipedia.org/wiki/Polygon_meshで確認できるように)頂点-頂点構造で表される3Dメッシュを描画したいと思います。
1)まず、頂点-頂点メッシュを表現する方法が正確にわかりません。次のようなデータ構造でいいのかな?
MPointArray vertices; //the position of all the vertices
MIntArray vertices_connects_counts; //how many other vertices each vertex connect with
MIntArray vertices_connects; //the index array storing each the vertices' index connected with all the vertices
例として、 http://en.wikipedia.org/wiki/Polygon_meshのキューブの例を取り上げます。
vertices_connects_counts = {5,5,5,5,5,5,5,5,4,4};
vertices_connects = {1,5,4,3,9,
2,6,5,0,9,
3,7,6,1,9,
2,6,7,4,9,
5,0,3,7,8,
6,1,0,4,8,
7,2,1,5,8,
4,3,2,6,8,
5,6,7,8,
0,1,2,3 };
2)次に、上記のデータ構造が正しい場合、openGLを使用してメッシュを描画する方法を知りたいですか?どのパラメータをglBegin()に渡す必要がありますか?