I am quite new to all this 3D stuff so I have a problem understanding how I can archive my goal.
I have a Web AR app build with Babylon JS to display artworks on your wall via AR. This is all working fine and I am really happy how easy to use and awesome babylon JS is even for someone completely new to anything 3d related.
But I face one issue I can’t find a solution for.
My object is an rectangular canvas and it rotates somewhat random around the z axis when I want to place it on a wall after the hit test was successfull.
I created an image to illustrate the issue and what I want to archive.
I have the bad solution at the moment and I want to get either the ok solution or better the perfect solution.
I don’t expect any code examples, I just need to get pointed in the right direction I hope.
Do I have to lock the Z-Axis of this quaternion thing I have for my canvas which is calculating the rotated position of my canvas?
And is it even possible to get to the perfect solution? Do I need other sensors of the phone for that too? And if so, are they available in the browser?
Thank you in advance for any help or hint.