Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Focus on single 'best' generated plane.

Discussion in 'AR' started by kingbaggot, Dec 16, 2017.

  1. kingbaggot


    Jun 6, 2013
    Hi - I'm really enjoying playing with the ARKit - it's really Too Much Fun.

    I'm trying to ape the 'show the single best plane' approach used in this popular dragon app - where it only generates a single plane and repositions it as you move about - allowing you to drop the dragon when you're happy with it's drop area. I thought limiting the planeAnchorMap in the anchormanager to only allowing 1 entry would work but of course it didn't.

    What is the best way to achieve this ? Apologies if this has been solved elsewhere - I've had a good trawl looking for an answer I promise !



    ps. Pigeon Panic and a few others do it in a similar fashion --->
    - I assume they're customising the debugPlanePrefab, but how these apps make it square is also something I've yet to figure out.
  2. shawnblais


    Oct 11, 2012
    It seems all they're doing is raycasting to a pt, on any plane, and if they have a pt, they position a content preview there. So it's not really using the plane at all, it's just assuming that there's a couple ft around the ray cast hit point. If you wanted to refine it further, you could have an inner collider on your prefab, and only show the preview if they're within that inner bounds.
    kingbaggot likes this.
  3. jimmya


    Unity Technologies

    Nov 15, 2016
    Have a look at the FocusSquare sample - might be more along the lines you're looking for.
    kingbaggot likes this.