Converting OpenGL transform matrix to FRotator

I want to convert an OpenGL transform matrix into an FRotator.

I go about this by getting the base axis from the OpenGL matrix and using the UKismetMathLibrary::MakeRotationFromAxes, but I am not getting correct results:

double matrix[16];

FVector X(matrix[0], matrix[1], matrix[2]); // OpenGL X
FVector Y(matrix[4], matrix[5], matrix[6]); // OpenGL Y
FVector Z(matrix[8], matrix[9], matrix[10]); // OpenGL Z

FRotator Rotation = UKismetMathLibrary::MakeRotationFromAxes(X, Y, Z); // Forward, Right, Up

This is clearly not working for anyting other than the identity matrix. When I sett the matrix to identity and getting X = 1,0,0 Y = 0,1,0 and Z = 0,0,1 for base axes this yields an FRotator with Pitch = 0, Yaw = 0 and Roll = 0, which is what I would expect.

What am i missing here?

UE4 has it’s own matrix implementation + it has some diffrent version of it if you look on refrence

In fact what function that you are using, just normalizeing vectors and make FMatrix out of it and then make FRotator out of it:

FRotator UKismetMathLibrary::MakeRotationFromAxes(FVector Forward, FVector Right, FVector Up)
{
	Forward.Normalize();
	Right.Normalize();
	Up.Normalize();

	FMatrix RotMatrix(Forward, Right, Up, FVector::ZeroVector);

	return RotMatrix.Rotator();
}

Maybe if you take it to FMatrix and it if you look on it’s function set it will let you move fearther with it. Personallly… i’m noob in matrixes, so other then that i can’t help you