FBX SDK importing cube normals not working

tyler5WSTU
Observer
Observer

FBX SDK importing cube normals not working

tyler5WSTU
Observer
Observer

I'm using the FBX SDK to import FBX files and read their vertices and normals.

 

I have a 'cube.fbx' in binary, and I have used the FBX converter to convert it to ascii 'cube (ascii).fbx'

 

When I import cube.fbx using the SDK, srcMesh->GetElementNormal()->GetDirectArray() is populated with all the normals as you would expect...

However, when importing 'cube (ascii).fbx', the normals array is seemingly zeroed out, and all normals are 0,0,0. The normals ARE present in the ascii FBX file.

 

Even using the sample code from the ImportScene example does not pull the normals properly...

 

Is this a bug in the library? or is there a way to work around this? Thanks!

0 Likes
Reply
Accepted solutions (1)
313 Views
3 Replies
Replies (3)

ilan.keshet
Enthusiast
Enthusiast

FBX does have a mesh->GenerateNormals  function that "sort of" works if the mesh has smoothing groups.  You can try that. 

 

However it doesn't always work -- though in a case of a cube it will work. 

 

I will have a look at the ascii cube from as well

0 Likes

ilan.keshet
Enthusiast
Enthusiast
Accepted solution

I can confirm that the normals in your cube ascii file are completely broken -- and can also confirm that using GenerateNormals will fix them. 

0 Likes

tyler5WSTU
Observer
Observer

Thank you 😄

0 Likes