- Home /
Start scene with geographic north-south orientation
What would be the way to match the x axis to north when starting a 3D AR scene?
I mean the plane, not the orientation of the camera or objects
Answer by Llama_w_2Ls · Feb 01, 2021 at 11:23 AM
You can use the gyroscope, from Input.Gyro
, to get the orientation of your device in world space. I believe that 0 degrees on the y axis, faces North every time. It might be another axis, I'm not sure. You can get the rotation of your device as a quaternion by using Input.gyro.attitude;
, and then get the euler angles from that rotation, to determine which direction your phone is facing, to orientate your plane.
Thanks, I'll try it. But which element should I rotate, ARSession, ARSession Origin or AR Camera? @Llama_w_2Ls
I've never worked with AR before. I assume your plane, since that's what you want.