views:

43

answers:

2

hi,

im tryin to extract vertice and uv map informatie from a fbx file created with 3ds max 2010. All i could get from the file are good vertice and polygon index data but wrong uv maps.

Can please someone help me pointing in a good direction or give me a tutorial.

Thanks for ready this.

+1  A: 

There is an example in the FBX SDK that shows you how to load mesh data into an OpenGL program. Work from that.

Goz
+1  A: 

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. DOWNLOAD LINK 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();
zezba9000