Hi there. I need figure out something guys. I find out Positions but can't figure out Rotation. There are values but they don't make any sense. I tried multiple them by 360.0 with not good results. On the image i manually set the most correct object rotation but can't find these values. Are they converted somehow? I serached for floats, doubles and nothing. It's possible that rotation are writen in integrers/shorts and converted with float modifier?
Found something... Maybe it is that case. But can't figure out how to convert it as Template for 010 HEX Editor. I think the order is x,y,z and it has something with "Tait-Bryan angles". All what i need is convert these values to degrees. If someone has an idea please help. Thanks in advance!
// Checks if a matrix is a valid rotation matrix. bool isRotationMatrix(Mat &R) { Mat Rt; transpose(R, Rt); Mat shouldBeIdentity = Rt * R; Mat I = Mat::eye(3,3, shouldBeIdentity.type());
return norm(I, shouldBeIdentity) < 1e-6;
}
// Calculates rotation matrix to euler angles // The result is the same as MATLAB except the order // of the euler angles ( x and z are swapped ). Vec3f rotationMatrixToEulerAngles(Mat &R) {
float x, y, z; if (!singular) { x = atan2(R.at<double>(2,1) , R.at<double>(2,2)); y = atan2(-R.at<double>(2,0), sy); z = atan2(R.at<double>(1,0), R.at<double>(0,0)); } else { x = atan2(-R.at<double>(1,2), R.at<double>(1,1)); y = atan2(-R.at<double>(2,0), sy); z = 0; } return Vec3f(x, y, z);
}
Structure of file is like: Got it. Order is Z,Y,X Now how to write code for 010 template to parse and output results???