Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by zyonneo · Jun 06, 2019 at 12:51 PM · unity 5iosaugmented reality

How to remove point clouds in Arkit?

After gettting the plane detected we remove the debugplane prefab that is the blue coloured rectangles. Similarly how to remove the point clouds that is coming once the plane is detected or after I place a 3d model on touch the plane(using UnityHitTest).

My objective is to hide planes and point clouds after arworldmap is loaded.Any idea?

 using UnityEngine;
 using UnityEngine.XR.iOS;
  
 public class PointCloudParticleExample : MonoBehaviour
 {
     public ParticleSystem pointCloudParticlePrefab;
     public int maxPointsToShow;
     public float particleSize = 1.0f;
     Vector3[] m_PointCloudData;
     bool frameUpdated = false;
     ParticleSystem currentPS;
     ParticleSystem.Particle [] particles;
     //added
     int loadcheck=0;
  
  
     //For creating instance of class
     public static PointCloudParticleExample pointinstance;
  
     // Use this for initialization
     void Start ()
     {
         UnityARSessionNativeInterface.ARFrameUpdatedEvent += ARFrameUpdated;
         WorldMapManager.offevent += particlesoff;//Added event
         currentPS = Instantiate (pointCloudParticlePrefab);
         m_PointCloudData = null;
         frameUpdated = false;
         pointinstance = this;
     }
    
     public void ARFrameUpdated(UnityARCamera camera)
     {
         if (camera.pointCloud != null)
         {
            m_PointCloudData = camera.pointCloud.Points;
         }
         frameUpdated = true;
     }
  
     // Update is called once per frame
     void Update ()
     {
      
         if (frameUpdated)
         {
             if (m_PointCloudData != null && m_PointCloudData.Length > 0 && maxPointsToShow > 0 && loadcheck == 0)
             {
                 int numParticles = Mathf.Min (m_PointCloudData.Length, maxPointsToShow);
                 ParticleSystem.Particle[] particles = new ParticleSystem.Particle[numParticles];
                 int index = 0;
                 foreach (Vector3 currentPoint in m_PointCloudData)
                 {    
                     particles [index].position = currentPoint;
                     particles [index].startColor = new Color (1.0f, 1.0f, 1.0f);
                     particles [index].startSize = particleSize;
                     index++;
                     Debug.Log("Points set to 0 called");
                     if (index >= numParticles) break;
                 }
                 currentPS.SetParticles (particles, numParticles);
  
  
             }
             else
             {
                 ParticleSystem.Particle[] particles = new ParticleSystem.Particle[1];
                 particles [0].startSize = 0.0f;
                 currentPS.SetParticles (particles, 1);
                 Debug.Log("Points set to 1 called");
             }
  
             //if(loadcheck==1)
             //{
             //    Debug.Log("Points set to 0 called");
             //    ParticleSystem.Particle[] particles = new ParticleSystem.Particle[1];
             //    particles[0].startSize = 0.0f;
             //    currentPS.SetParticles(particles, 1);
             //    Debug.Log("Points set to 0 called");
  
             //}
  
             frameUpdated = false;
         }
     }
  
     public void particlesoff(UnityARCamera arcamera)
     {
         //var points = arcamera.pointCloud.Points;
         //if (points == null)
         //{
         //    Debug.Log("No points");
         //    return;
         //}
  
         //else
         //{
         //    //foreach (var poi in points)
         //    //{
         //    //    poi.Scale(new Vector3(0, 0, 0));
  
         //    //    Debug.Log("Points set to 0 " + poi.x+" : "+ poi.y + " : "+poi.z);
         //    //    //currentPS.SetParticles (points, 0);
  
         //    //}
          
         //    int numParticles = Mathf.Min(m_PointCloudData.Length, maxPointsToShow);
         //    Debug.Log("numParticles length " + numParticles);
         //    int index = 0;
         //    Debug.Log("m_PointCloudData length " + m_PointCloudData.Length);
         //    foreach(Vector3 currentPoint in m_PointCloudData)
         //        {
         //        Debug.Log("currentPoint Positions " + currentPoint.x +" : "+currentPoint.y + " : "+currentPoint.z);
         //        particles[index].position = currentPoint;
         //        //particles[index].startColor = new Color(1.0f, 1.0f, 1.0f);
         //        particles[index].startSize = 0f;
         //        index++;
         //        if (index >= numParticles) break;
         //       }
         //    currentPS.SetParticles(particles, numParticles);
  
         //}
  
  
     }
  
  
  
     public void particlesoffcheck()
     {
  
         loadcheck = 1;
     }
  
 }
  

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

145 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity augmented reality based app keep crashing after building it on ios 1 Answer

Services not working in iOS but fine in Android build 0 Answers

xCode pods problem when building for iOS 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

ARFoundation body recognition doesn't work 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges