I am reading my vertices,normals and indices from fbx files which are exported by maya and 3dsmax. When I apply the transformation, all the objects are in their correct position even the animations work fine. However at some meshes, normals are inverse and index orders are anti clockwise which I confirmed this by disabling culling. I realized that some objects had negative scaling, so I recursively calculated sign of the scale
//pesudo code
sc=1
do{
// I only use sign of x axis, as y and z always follow the same sign in my models.
sc=sc*node->localscaling(0)
}while(node=node->parent)
if(sc<0)
mesh.rewind
for each object by also reaching to their parent's scaling and rewinded those produced negative scale and mirrored their normals around origin. While this worked for 1-2 objects, this time some of the correct objects looked wrong. So I guess I need another criteria to decide which objects/meshes to rewind.Any suggestions?