Exact camera rotation matrix and rotation order used by RealityCapture

Hi everyone,

I’m trying to visualize RealityCapture camera poses in my own tool (Three.js) and I’d like to match RealityCapture’s camera orientation exactly.

For that, I need to know the exact form of the rotation matrix that RealityCapture uses, expressed explicitly with cos/sin of the three angles, and also the rotation order (which axis is rotated first, second, third).

Concretely, my questions are:

  1. Which rotation order does RealityCapture use for its three angles?

  2. What is the explicit 3×3 rotation matrix in terms of the three angles?
    For example, in the style:

    R = [ r11 r12 r13
          r21 r22 r23
          r31 r32 r33 ]
    
    r11 = cos(φ)*cos(κ) + ...
    r12 = ...
    ...
    
    

    I’d like to know the exact formulas RealityCapture uses internally (with sin/cos of the angles), so I can reproduce them 1:1.

  3. Are these angles interpreted as rotations that map:

    • from world to camera coordinates, or

    • from camera to world coordinates?

    (i.e. is the exported rotation matrix R such that X_cam = R * X_world or the other way around?)

I’m not looking for a general Euler-angles explanation, but specifically for the RealityCapture definition: rotation order and the precise matrix entries.

If someone from the RC team or anyone who has already reverse-engineered/verified this could post the exact formulas, that would be super helpful.

Thanks in advance!

You can check this post about it: Importing camera alignment in THREE.JS

It looks like there is some answer in the link from the first comment.

There you can find also some additional information: Camera Parameters in the output XMP file