Search Unity

ARFoundation - Anchor without a full plane

Discussion in 'AR' started by newguy123, Nov 13, 2018.

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Hi all

    In this Unity presentation (move to slide 14):
    https://www.slideshare.net/unity3d/secrets-to-creating-the-best-ar-experiences

    ...they have 3 points there. I'm trying to understand exactly what they mean, and then wonder exactly how one would implement it.

    For now, I have an intro screen, roughly expaining what to do. The user taps and then goes over to the AR Scene. Following the points on the above slide, how would we start without tracking and also how would we anchor without a full plane?

    Currently I'm using the default plane, which as far I understand 1st requires some tracking, then the prefab we place on the plane is anchored to the plane. The slide seems to suggest we can skip all that, or what am I missing or not understanding?

    Then on the next slide (slide 15). They say show object "ghost". Hmmm so then is that your prefab to place, just with a different shader or what do they mean by that? Also if the prefab is not placed yet, but is huge, would we need to already scale the "ghost" without placing???
     
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    I believe by "start without tracking", they mean that you can start to show screen space UI before tracking is fully established, i.e., before ARSubsystem.systemState is ARSystemState.SessionTracking.

    By "Anchor without full plane", they meant that you could start to place content when a small plane (e.g., too small to place the real content) is first detected (note that you can raycast against the infinite plane). Or you can show a few point cloud points to indicate that something is happening.
     
  3. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Also, here is a link to a video of the presentation, which might provide more explanation than just the slides:
     
    newguy123 likes this.
  4. sarah_stumbo

    sarah_stumbo

    Unity Technologies

    Joined:
    May 13, 2017
    Posts:
    2
    Hey! These were just suggestions of ways you could show content to the user while still searching for planes, so that they aren't staring at an empty passthrough camera while waiting. You can start to preview objects by having them "anchored" to the camera itself before it is placed in the world space. I wouldn't recommend showing a huge prefab as a ghost before placing it, but this method works well for smaller objects.
     
    IsDon, Saicopate and newguy123 like this.
  5. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Yes I saw the video thanks.

    Ooooooh cool could you tell me how to do that please? Currently all the examples on github seem to place the prefab onto an AR Plane prefab and the raycast code for it is also based around a plane or boundary polygon of sorts. I'd love to let the user place the model as soon as possible either on the floor in real world or on a surface like a table in real world. The default AR Plane system probably has a use, but I don't think its for me as it's very ugly and for my needs I don't see the benefits yet. A focus square kind of thing will probably look better for my needs or showing some point clouds and sticking the model onto one of the points. Hopefully hiding the points after placing is as simple as the hiding planes example in the samples.

    I'd much rather let the user place an object practically instantly if possible without having any planes visualised.

    Hmmm actually now that I think of it, is it possible to auto place the model on the 1st horizontal surface that is detected without having the user tap to place it? (and then also auto hide the plane). That way it doesnt really matter what the ugly plane looks like as nobody will ever see it.

    Cool thanks Sarah, nice presentation and talk! Would it be possible to get a simplified version of the portal app you used in your talk, into the samples on github please? Even something like the door screenshot above could be good.
     
  6. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    This is the line of code that performs the raycast. Note the last argument is TrackableType.PlaneWithinPolygon. There are several options, one of which is PlaneWithinInfinity.

    Sure. You can hook the ARPlaneManager.planeAdded event and perform your logic there. If you never want planes visualized, use a different plane prefab, or disable the visualizer programmatically in the planeAdded callback.