/// <summary>
        /// Runs the session with a new AR configuration to change modes or reset the experience.
        /// </summary>
        private void ResetTracking(bool changeTextureMode = false)
        {
            var configuration = new ARWorldTrackingConfiguration();

            configuration.PlaneDetection       = ARPlaneDetection.Horizontal;
            configuration.EnvironmentTexturing = this.currentTexturingMode;

            var session = this.sceneView.Session;

            if (changeTextureMode)
            {
                // Remove existing environment probe anchors.
                if (session.CurrentFrame?.Anchors != null)
                {
                    foreach (var anchor in session.CurrentFrame.Anchors)
                    {
                        session.RemoveAnchor(anchor);
                    }
                }

                // Don't reset tracking when changing modes in the same session.
                session.Run(configuration);
            }
            else
            {
                session.Run(configuration, ARSessionRunOptions.ResetTracking | ARSessionRunOptions.RemoveExistingAnchors);
            }

            this.isEnvironmentTextureAvailable = false;
            this.sceneEnvironmentProbeAnchor?.Dispose();
            this.sceneEnvironmentProbeAnchor = null;
            configuration.Dispose();
            session.Dispose();
        }
Beispiel #2
0
        private void RunSession()
        {
            config?.Dispose();
            sceneView?.Delegate?.Dispose();

            config = new ARWorldTrackingConfiguration();
            sceneView.Session.Run(config, ARSessionRunOptions.ResetTracking | ARSessionRunOptions.RemoveExistingAnchors);

            //Permite añadir reflejos a los objetos de la escena
            sceneView.AutoenablesDefaultLighting = true;
        }
Beispiel #3
0
        private void RunSession()
        {
            config?.Dispose();
            sceneView?.Delegate?.Dispose();

            config = new ARWorldTrackingConfiguration();
            sceneView.DebugOptions = ARSCNDebugOptions.ShowFeaturePoints | ARSCNDebugOptions.ShowWorldOrigin;
            config.PlaneDetection  = ARPlaneDetection.Horizontal;
            sceneView.Session.Run(config, ARSessionRunOptions.ResetTracking | ARSessionRunOptions.RemoveExistingAnchors);

            //Permite añadir reflejos a los objetos de la escena
            sceneView.AutoenablesDefaultLighting = true;
        }
        private void RunSession()
        {
            config?.Dispose();
            sceneView?.Delegate?.Dispose();

            config = new ARWorldTrackingConfiguration();
            config.AutoFocusEnabled             = true;
            config.PlaneDetection               = ARPlaneDetection.Horizontal | ARPlaneDetection.Vertical;
            config.LightEstimationEnabled       = true;
            config.WorldAlignment               = ARWorldAlignment.GravityAndHeading;
            config.DetectionImages              = ARReferenceImage.GetReferenceImagesInGroup("AR Resources", null);
            config.MaximumNumberOfTrackedImages = 1;

            sceneView.Session.Run(config, ARSessionRunOptions.ResetTracking | ARSessionRunOptions.RemoveExistingAnchors);
            sceneView.Delegate = new IrScnDelegate();
        }
Beispiel #5
0
        private void RunSession()
        {
            config?.Dispose();
            sceneView?.Delegate?.Dispose();

            sceneView.DebugOptions = ARSCNDebugOptions.ShowFeaturePoints;

            //TODO 6.1 Configurando detección de imágenes
            config = new ARWorldTrackingConfiguration();
            config.AutoFocusEnabled             = true;
            config.PlaneDetection               = ARPlaneDetection.Horizontal | ARPlaneDetection.Vertical;
            config.LightEstimationEnabled       = true;
            config.WorldAlignment               = ARWorldAlignment.GravityAndHeading;
            config.DetectionImages              = ARReferenceImage.GetReferenceImagesInGroup("AR Resources", null);;
            config.MaximumNumberOfTrackedImages = 1;

            sceneView.Session.Run(config, ARSessionRunOptions.ResetTracking | ARSessionRunOptions.RemoveExistingAnchors);

            sceneView.Delegate = new ArImageRecognitionScnViewDelegate(Element.Model3D);

            //Permite añadir reflejos a los objetos de la escena
            sceneView.AutoenablesDefaultLighting = true;
        }