Thursday, March 23, 2006

Indexing into MFnMesh::getBinormals?

Category: API


MFnMesh::getBinormals dumps a mesh's binormals into a MFloatVectorArray, but its length is different from getNormals'. How do you index into this array? You can't. There's one binormal for each vertex-face pair. So if a vertex is shared by 4 faces, then it will have 4 binormals. getBinormals will go through all the vertices in the mesh in order, and output all their binormals in this long one-dimensional array. Therefore there is no way to index into this array without knowing the mesh's topology beforehand.

Use getFaceVertexBinormals instead.

Then what's the purpose for this function? It can be handy to be use it to dump all the binormal data to a file for exporting.

The samething goes for getTangents.

1 comment:

Anonymous said...

So... now ... Maya better or 3DMAX ??? Don't tell me still 3DMAX ...