Hi !

If you work with Beta products you will find funny scenarios, like something working, then not working, then working again. The next Hololens forums thread is a must read if you want to understand the frustration you can get in this scenarios:

VS2017/U5.6 Crash – WinRTScriptingObjectWrapper::InternalAddRef Reference Count cannot be zero (link)

TLTR HoloToolkit current version is not officially supported for the combo Visual Studio 2017 and Unity3D 5.6. 

There are features like Tap To Place which are not working fine with VS2017 and Unity3D 5.6. If you implement this, as soon as the Hololens App starts, it will crash and close. Without any clear explanation on what´s happening. It seems to be something related to World Anchors and the way Unity are is working with this,  this issue is still alive on GitHub (link).

So, I need Tap To Place, and I decided to implement this myself. I pickup some code from HoloToolkit and some other pieces from Holographic Academy tutorials and I’ve created 2 main classes which fix the problem, and also add some additional value. Here are the main implemented features

  • We can perform an initial scan of an environment, based on a time constraint. Also we can continue the scan process if we don’t find a minimum of number of planes for floor or wall
  • We can associate one class to an hologram to have the Tap to Place feature
  • This process also allow us to validate if we can place the hologram in a vertical (wall) or horizontal (floor) plane
  • The validation process also have some visual features like change the color of a box collider from red to green depending if we can or can’t place an object and also cast a shadow with the final location of the hologram

In the next animation we can see a cylinder hologram with the following configuration:

  • Green material for the rigid box for valid place
  • Red material for the rigid box for invalid place
  • No shadows enabled

2017 04 26 Holo TapToPlace with Validation 01

The complete source code can be downloaded from GitHub (link).

Greetings @ Toronto

El Bruno

References

20 responses to “#Hololens – Alternative fix to the TapToPlace and WorldAnchor issue (until official #HoloToolkit release)”

  1. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  2. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  3. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  4. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  5. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  6. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  7. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  8. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  9. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  10. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  11. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  12. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  13. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  14. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  15. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  16. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  17. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  18. […] Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolki… […]

    Like

  19. Hello! Thank you for this blog post and the sample code, very useful!
    Unfortunately I tried to import your project into Unity in order to test it, and it’s not working. 😦
    There are 4 “missing prefab” in the scene, and the “Script”, “TextDebugDisplay” and “Player” objects have the references to the correct scripts missing; how can I fix these?

    Like

    1. Hi Ocramot
      Let me double check the sample files in GitHub. I may forgot to add some files
      Regards
      -Bruno

      Like

Leave a comment

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading