[osg-users] [Help] OSG + ArKit: Problem converting coordinate system

Rodrigo Brayner Lyra rbl2 at cin.ufpe.br
Mon Oct 8 12:08:04 PDT 2018


I'm working on a project that will render a scene using openscenegraph, and the user will have the option to work with this scene in AR. The integration of ArKit in the application is almost complete, except in the conversion of ArKit's view matrix to the coordinate system used by OSG. 

I uploaded the render of the OSG axis helper and the ArKit axis helper. As you can see, the y in OSG is x in ArKit, the x in OSG is z in ArKit and the z in OSG is y in ArKit. With that, I thought that if I switched the axes directly into the view matrix it would be correct. What I have tried can be seen in the two attachments with the code fragment that converts the ArKit view matrix into an OSG view matrix (ar_conv_vector_change and ar_conv_values_change). 
None of them worked completely except that one of them was correct in the rotations and translations of the camera, but the position and initial rotation of the scene was completely wrong (The wall should be in the same position and point of view as before at the time that the AR mode is started, but was positioned as shown in the switched_values_view image).

In the end, the camera view matrix is:
m_camera_matrix = m_camera_view * ar_view_matrix;

I apologize for the long text, and I ask the support of the people of this forum, and if there is, who has already gone through this situation (with ArKit or other APIs)

Thank you!


Read this topic online here:


More information about the osg-users mailing list