Forum Xamarin.iOS

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Extracting camera orientation from arkit?

LeloLelo Member ✭✭✭

How can I extract camera orientation from arkit?
I am not looking for creating the ar in the iOS project but just looking for the values so that I can use them in my forms project

Tagged:

Best Answer

Answers

  • LeloLelo Member ✭✭✭

    It seems be possible. But the camera view drops when I:

    ARView.SCNView?.Session?.CurrentFrame?.Camera?.EulerAngles
    

    The camera view without getting those eulerAngles works fine

  • LeloLelo Member ✭✭✭
    edited January 5

    It is the same for when implementing ARSessionDelegate:

    [Export("session:didUpdateFrame:")]
    public void DidUpdateFrame(ARSession session, ARFrame frame)
    {
        Console.WriteLine("anything");
    }
    

    It logs in spikes

  • LeloLelo Member ✭✭✭
    edited January 5

    It's reproducible by downloading this sample: https://github.com/michaelzaletel/ARFormsSample
    In ARPageRenderer.cs in TouchesBegan method place the following path the bottom:

    var session = scnView.Session.CurrentFrame;
    Console.WriteLine(session);
    

    It starts to lag when you tap to add more cubes and freezes the camera after a few touches

  • LeloLelo Member ✭✭✭
    Accepted Answer

    It was possible extract them with

    using (var frame = scnView.Session.CurrentFrame)  {
        // Do stuff with the frame
        Console.WriteLine (frame.Description);
    }
    
    

    Got help form dalexsoto: https://github.com/xamarin/xamarin-macios/issues/10341

Sign In or Register to comment.