OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

[Help] OSG + ArKit: Problem converting coordinate system


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Brayner
Newbie


Joined: 09 May 2018
Posts: 2

PostPosted: Mon Oct 08, 2018 7:07 pm    Post subject:
[Help] OSG + ArKit: Problem converting coordinate system
Reply with quote

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
Back to top
View user's profile Send private message
Raymond de Vries
Guest





PostPosted: Tue Oct 09, 2018 7:06 am    Post subject:
[Help] OSG + ArKit: Problem converting coordinate system
Reply with quote

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:
Quote:
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




---
This email has been checked for viruses by AVG.
https://www.avg.com




------------------
Post generated by Mail2Forum
Back to top
Voerman, L.
Guest





PostPosted: Tue Oct 09, 2018 7:59 am    Post subject:
[Help] OSG + ArKit: Problem converting coordinate system
Reply with quote

Hi  Rodrigo,I don't fully grasp your question, but i noticed that you say you want to swap axis while the matrix in ar_conv_values_change_120.jpeg has a last column in a different order than the first three. 
Laurens.


On Tue, Oct 9, 2018 at 9:06 AM Raymond de Vries < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
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:
Quote:
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
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

---
This email has been checked for viruses by AVG.
https://www.avg.com


_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
Brayner
Newbie


Joined: 09 May 2018
Posts: 2

PostPosted: Tue Oct 09, 2018 1:57 pm    Post subject:
Reply with quote

Hi Raymond,

I took a look at the submitted sample, and from what I've noticed, unfortunately it is unfeasible to migrate now to ArToolkit because of the project structure, which was all based on OSG, and as I could understand, ArToolkit + OSG uses pure OpenGL calls. Unfortunately the deadline is very near.

Hi Laurens,
The last column is unchanged because it is always 0 (except the value in the last row, which is 1). so the order of the last column doesn't matter.

Thank you!

Cheers,
Rodrigo
Back to top
View user's profile Send private message
kornerr
Appreciator


Joined: 01 Oct 2013
Posts: 282

PostPosted: Wed Oct 10, 2018 7:59 am    Post subject:
[Help] OSG + ArKit: Problem converting coordinate system
Reply with quote

Hi.
I would recommend to create a small example depicting the problem and
host it on GitHub. That way others may actually try to run it and play
with it instead of guessing.
On Tue, 9 Oct 2018 at 17:25, Rodrigo Brayner Lyra <> wrote:
Quote:

Hi Raymond,

I took a look at the submitted sample, and from what I've noticed, unfortunately it is unfeasible to migrate now to ArToolkit because of the project structure, which was all based on OSG, and as I could understand, ArToolkit + OSG uses pure OpenGL calls. Unfortunately the deadline is very near.

Hi Laurens,
The last column is unchanged because it is always 0 (except the value in the last row, which is 1). so the order of the last column doesn't matter.

Thank you!

Cheers,
Rodrigo

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75054#75054








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem with output - OSG/Shader romulogcerqueira General 3 Sat Aug 04, 2018 6:36 pm View latest post
No new posts Converting PrimitiveSet to use triang... Waaayoff General 7 Fri Jul 27, 2018 12:06 pm View latest post
No new posts problem with picking/intersecting in ... mue General 1 Sat Jun 09, 2018 11:18 am View latest post
No new posts osgText: problem with SCREEN_COORDS mode gwaldron General 9 Thu May 17, 2018 3:56 pm View latest post
No new posts No specular maps, exporting from blen... Klemen Červ Plugins [osgPlugins] 1 Wed May 16, 2018 1:08 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP