Start a new topic

mgMeshPrimitiveGetNumVtx and mgMeshPrimitiveGetVtxIndexArray

Original Post by: perezucf Mon Nov 4 16:50:20 2013


I am always getting a return value of zero from mgMeshPrimitiveGetVtxIndexArray even though I get valid values back from mgMeshPrimitiveGetNumVtx with the same mesh and primitive number. According to the documentation "The actual number of vertex indices returned is the smaller of maxLen and the number of vertex indices in the specified mesh primitive." I pass in the number of vertex indices in the specified mesh primitive as my maxLen so how am I getting zero?


Original Post by: perezucf Mon Nov 4 17:51:57 2013


The index array was NULL. Thanks for all the help!

Original Post by: SteveThompson Mon Nov 4 17:28:38 2013


mgMeshPrimitiveGetVtxIndexArray will pass back zero if any of the following are true:


- The rec you pass is not a mesh

- The primNo you specify is not a primitive of the mesh (first primitive is 0)

- The indexArray you pass to "fill in" is NULL

- The maxLen you pass is 0


I just double checked here and it seems to work fine given the criteria above.

Login to post a comment