The resulting glTF has incorrect normals as a result.
To work around the issue, I have changed the macro GetLayerElement to use the MappingMode rather than the ReferenceMode, like so
#define GetLayerElement(layerElt, indexV, T, V, index, lambda)
int indexV =-1 ;
T V ;
if ( layerElt ) {
indexV =(layerElt->GetMappingMode () == FbxLayerElement::eByPolygonVertex ? index : layerElt->GetIndexArray () [index]) ;
V =layerElt->GetDirectArray ().GetAt (indexV) ;
lambda (V) ;
}
Models that demonstrate the problem are here
https://github.com/alinen/FBX-glTF/tree/master/three.js/models/drone_shell (needs updated three.js too)
https://github.com/alinen/FBX-glTF/tree/master/three.js/models/airplane
I would be interested in knowing the proper fix!
The resulting glTF has incorrect normals as a result.
To work around the issue, I have changed the macro GetLayerElement to use the MappingMode rather than the ReferenceMode, like so
#define GetLayerElement(layerElt, indexV, T, V, index, lambda)
int indexV =-1 ;
T V ;
if ( layerElt ) {
indexV =(layerElt->GetMappingMode () == FbxLayerElement::eByPolygonVertex ? index : layerElt->GetIndexArray () [index]) ;
V =layerElt->GetDirectArray ().GetAt (indexV) ;
lambda (V) ;
}
Models that demonstrate the problem are here
https://github.com/alinen/FBX-glTF/tree/master/three.js/models/drone_shell (needs updated three.js too)
https://github.com/alinen/FBX-glTF/tree/master/three.js/models/airplane
I would be interested in knowing the proper fix!