I am trying to get the sign of the scale for each axis. but it works only when all 3 axes are of same sign. here is the code I am using:
glm::vec3 Xaxis(matrix[0][0],matrix[0][1],matrix[0][2]);
glm::vec3 Yaxis(matrix[1][0],matrix[1][1],matrix[1][2]);
glm::vec3 Zaxis(matrix[2][0],matrix[2][1],matrix[2][2]);
double zs=glm::dot(glm::cross(Xaxis,Yaxis),Zaxis);
double ys=glm::dot(glm::cross(Zaxis,Xaxis),Yaxis);
double xs=glm::dot(glm::cross(Yaxis,Zaxis),Xaxis);
xs=std::signbit(xs);
ys=std::signbit(ys);
zs=std::signbit(zs);
which fails for this example:
float []mat={0.032254f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.0052254f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.4332254f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};