开发者

Extract vertex data from an FBX file?

I'm trying to extract vertex and UV map information from a FBX file created with 3ds开发者_Go百科 max 2010.

All i could get from the file are good vertex and polygon index data but wrong UV maps.

Can someone point me in a good direction or give me a tutorial?


Note that when you load Normals for a object that is perfectly smooth they index differently then when not smooth.

Here is a link to some code I have made to load a FBX file into system memory... thought it might help You want to look at "MedelProcess_Mesh.cpp" btw to answer some questions you might have. Hope this helps, remember I have no animation support in there.

SIMPLE ANSWER::

For UVs.

int uvIndex1 = mesh->GetTextureUVIndex(polyIndex, 0);
int uvIndex2 = mesh->GetTextureUVIndex(polyIndex, 1);
int uvIndex3 = mesh->GetTextureUVIndex(polyIndex, 2);
KFbxVector2 uv1 = uv->GetAt(uvIndex1);
KFbxVector2 uv2 = uv->GetAt(uvIndex2);
KFbxVector2 uv3 = uv->GetAt(uvIndex3);

For Verts.

int vertexCount = mesh->GetControlPointsCount();
KFbxVector4* vertexArray = mesh->GetControlPoints();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜