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

Raymond de Vries reedevee at gmail.com
Tue Oct 9 00:06:04 PDT 2018


Hi Rodrigo,

Without having read your mail in detail I have a suggestion. Do you know 
artoolkit and the integration with osg? It sounds to me that you can 
learn from that project.

https://github.com/artoolkit/artoolkit5
https://github.com/artoolkit/artoolkit5/tree/master/examples/simpleOSG

Please keep us/me posted. Sounds like a nice project, have fun!

Cheers,
Raymond




On 10/8/2018 9:08 PM, Rodrigo Brayner Lyra wrote:
> Hi,
>
> 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!
>
> Cheers,
> Rodrigo
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=75048#75048
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/switched_values_view_100.jpg
> http://forum.openscenegraph.org//files/ar_conv_values_change_120.jpeg
> http://forum.openscenegraph.org//files/ar_conv_vector_change_297.jpeg
> http://forum.openscenegraph.org//files/osg_axis_731.png
> http://forum.openscenegraph.org//files/arkit_axis_176.jpg
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> ---
> This email has been checked for viruses by AVG.
> https://www.avg.com
>



More information about the osg-users mailing list