Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.07k stars 1.15k forks source link

The unity world z-axis-north alignment the real world north #502

Closed ccy317912 closed 4 years ago

ccy317912 commented 4 years ago

I want to achieve the goal,but i dont know how to do ,when the phone start different direction,in AR its different direction angle.When AR lost tracking ,its different direction angle again.Would the arfoundation realize unity world z-axis-north alignment the real world north and AR lost tracking?

tdmowrer commented 4 years ago

When the session begins, the device has identity transform; it is not dependent on compass direction, so, no, ARFoundation does not "realize unity world z-axis-north alignment".

ccy317912 commented 4 years ago

I used "Input.gyro" control camera to made one simple AR ,it's very alignment unity world z-axis-north to the real world north but has some shake. In arfoundation, phone start different direction whether start or lost tracking it's face to unity z-axis.

tdmowrer commented 4 years ago

Sorry, I don't understand. Can you rephrase your explanation?

ccy317912 commented 4 years ago

I put my demo on this link https://github.com/ccy317912/NotAlignmentNorth ,you can install apk on your android phone.its has two scenes ,one is ARFoundation scene,another one is InputGyro scene,i put compass sprite on each scenes ,you will see the ARFoundation scene when start different direction it's face to unity z-axis.

tdmowrer commented 4 years ago

If I understand correctly, you want to align the ARSession with a compass direction. You can compute an appropriate rotation and rotate the ARSession (just update its Transform component).

ccy317912 commented 4 years ago

year,i konw how to do it .can it auto align ?