Coder Social home page Coder Social logo

Comments (13)

 avatar commented on July 18, 2024 1

@southrop Thanks; was able to repro, and I know what the issue is. This should solve @Leiong 's problem too.

In your point cloud prefab, change the "Scaling Mode" to "Hierarchy":
scalemodehierarchy

This is what I use to test, but for some reason the point cloud created from the XR menu produces one with Scaling Mode set to "Local". I'll fix the generation util to use the correct setting.

from arfoundation-samples.

 avatar commented on July 18, 2024

Hi Leiong,

Question 1: I want to scale the content rendered by ARSessionOrigin, arsessionOrigin.transform.localScale = Vector3.one * scaleValue, but it will affect the point cloud particle effects. It looks strange, is it something I missed?

Could you post a screen shot of the "strange" result?

Problem 2: Disable ARsession, then enable ARSession, the previous plane still appears and cannot be cleared. I need to implement enable AR, reset AR, close AR, how do I need to set it up;

Thanks for the code snippet. You should not set ARSubsystemManager.systemState yourself (the setter should be private -- it's a mistake that it isn't). The correct way to reset the session is to Destroy it and re-add it, though there are some known issues with this, particularly on ARKit. This will be fixed in the next preview release. I'm also going to add a method Reset to the ARSession to make this easier.

from arfoundation-samples.

Leiong avatar Leiong commented on July 18, 2024

Hi Timm,
Question 1: When I want to scale the content rendered by ARSessionOrigin, the position of the particle effect is wrong, and the size of the border changes. This is not the result I want.
img_0033
img_0034
Question 2:After the Cube is generated, is there a way to remove the particle effects and planes? This will not affect my observation of the object.
(Sorry, this is the text of Google Translate, I hope you can understand it......)

from arfoundation-samples.

 avatar commented on July 18, 2024

Question 1: When I want to scale the content rendered by ARSessionOrigin, the position of the particle effect is wrong, and the size of the border changes. This is not the result I want.

Does your point cloud prefab have a non-zero position? It looks like an extra offset is being applied. The line renderer being affected by scale is currently expected. The outline is mostly for debugging purposes. You can simply remove the line renderer from your prefab if you don't want it.

Question 2:After the Cube is generated, is there a way to remove the particle effects and planes? This will not affect my observation of the object.

Yes. To disable plane detection and point cloud updates, you can disable their managers: ARPlaneManager and ARPointCloudManager, respectively. To remove existing planes/point cloud from the scene, you can disable or remove their GameObjects. You can get all the planes with ARPlaneManager.GetAllPlanes and the point cloud with ARPointCloudManager.pointCloud

from arfoundation-samples.

southrop avatar southrop commented on July 18, 2024

I was having a similar issue to this and scaling the point cloud prefab by the same scale as the ARSessionOrigin resolved the issue for me.

from arfoundation-samples.

 avatar commented on July 18, 2024

I was having a similar issue to this and scaling the point cloud prefab by the same scale as the ARSessionOrigin resolved the issue for me.

That sounds odd. What does your scene hierarchy look like? Does your point cloud prefab have an identity transform?

from arfoundation-samples.

Leiong avatar Leiong commented on July 18, 2024

Yes. To disable plane detection and point cloud updates, you can disable their managers: ARPlaneManager and ARPointCloudManager, respectively. To remove existing planes/point cloud from the scene, you can disable or remove their GameObjects. You can get all the planes with ARPlaneManager.GetAllPlanes and the point cloud with ARPointCloudManager.pointCloud

After the Cube is generated,remove existing planes/point cloud from the scene
001
But the planes/point cloud did not appear when ARSession.Reset();
002

Does your point cloud prefab have a non-zero position? It looks like an extra offset is being applied. The line renderer being affected by scale is currently expected. The outline is mostly for debugging purposes. You can simply remove the line renderer from your prefab if you don't want it.
003

the point cloud prefab have a non-zero position, but this problem will still appear,Is the method like this?
004

from arfoundation-samples.

southrop avatar southrop commented on July 18, 2024

That sounds odd. What does your scene hierarchy look like? Does your point cloud prefab have an identity transform?

My scene hierarchy looks like this. Aside from a few UI-related addition and a camera clipping plane tweak (to account for the 300 scale), it's identical to the sample.

image

I use the default point cloud prefab generated from the Right-Click menu entry, and it has a completely zero'd out transform with the exception of scale.

from arfoundation-samples.

 avatar commented on July 18, 2024

@Leiong
Thanks for the screenshots! Very helpful.

But the planes/point cloud did not appear when ARSession.Reset();

Did you also re-enable the point cloud and plane managers? It looks like you disable them, then reset the ARSession, but don't re-enable them. If those managers are disabled, then plane detection and point cloud updates are disabled.

the point cloud prefab have a non-zero position, but this problem will still appear

The image you posted is of the plane prefab. Can you double check the point cloud prefab?

Is the method like this?

That is the correct way to scale the ARSessionOrigin, yes.

from arfoundation-samples.

 avatar commented on July 18, 2024

@southrop Hmm. Could you share your project? Either here or send it to me at [email protected]

from arfoundation-samples.

southrop avatar southrop commented on July 18, 2024

@timm-unity I've sent you an email with a replication

from arfoundation-samples.

southrop avatar southrop commented on July 18, 2024

@timm-unity Brilliant, that resolves it!

While you're making changes to the generation util, perhaps it's worth mentioning that the default point cloud gameobject gets created with the name AR Default Point Cloud with a space at the end. Not really a big issue but seems unintentional.

from arfoundation-samples.

 avatar commented on July 18, 2024

Nice catch; will do!

from arfoundation-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.