Recommended Posts

Hi, i have problem with getting tex coords and normals from KFbxMesh class. I read(some days ago) that coords and normals are kept in layers of mesh, but how can i take them for one object? i Mean i have tab of verices, indices and now i would like to have tab of coords and tab of normals. How to do that?Thanks, for any useful advices.

0

Share this post

Link to post

Share on other sites

I actually had the same problem a few weeks ago but fortunately managed to figure it out. The FBX SDK seems to really be lacking in documentation, so it took a lot of guesswork. Anyway, take a look at my code in this post.

Share this post

Link to post

Share on other sites

Have you tried KFbxMesh->GetPolygonVertexNormal() for getting the normals? Haven't tested it too mutch, but seems to work so far. If the mesh doesn't have normals you could try KFbxMesh->InitNormals() and KFbxMesh->ComputeNormals() and let the SDK generate them or just compute them yourself once the mesh is fully loaded.

For texture coordinates things are a little bit more complicated, as there is no other way then extracting them from the layers and work out the mapping/reference modes. It's the same as for normals in Gumgos example.

As for other examples of working with the FBX SDK, the best I've found so far is the ContentExporter sample that comes with the latest DirectX SDK. Seems to be quite complete when it comes to extracting the relevant information thats needed for realtime rendering.

0

Share this post

Link to post

Share on other sites

I really don`t know how to use GetPolygonVertexNormal(). For extracting vertices for example i use mesh->GetControlPoints(), so its another way than GetPolygonVertexNormal(). Can u show me example how to use it?