Skip to content
forked from manniru/HeartAR

ARCore sample project that visualizes the human heart on a marker and allows to freely place and transform nerve cells.

License

Notifications You must be signed in to change notification settings

Surfshub/HeartAR

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HeartAR

ARCore sample project that visualizes the human heart on a marker and allows to freely place and transform nerve cells.

What is this about?

This project extends the samples that ship with the Google ARCore for Unity SDK. It combines multiple scenarios:

  • Augmented Images (marker tracking): allows a 1:1 relationship between marker and associated 3D model / prefab to create. Only instantiates every object once in the world.
    See script: MarkerAnchorController.cs
    Difference to Original Google example: uses the same Prefab for every augmented image in the database. Sets up the correct object hierarchy in Unity (Anchor -> Prefab) and deletes the item as well as its anchor when tracking is lost.

  • Plane Anchoring: Tap on a detected plane to position an item. Not activated by default in the scene. See script: PlaneAnchorController.cs
    Difference to Original Google example: Checks if the plane has been lost and cleans up the anchor + insantiated prefab.

  • Plane Anchoring + Manipulation: Tap on a detected plane to position an item, with the manipulation system in place. Allows moving, rotating and scaling objects that have been placed in the scene.
    See script: ManipulatorController.cs
    Difference to Original Google example: Checks if the plane has been lost and cleans up the anchor + insantiated prefab.

  • Lifecycle: Takes care of permissions, screen time out and quitting the app.
    See script: LifecycleController.cs
    Difference to Original Google example: Completely integrated into the HelloAR example from the SDK. But these tasks are good to have in an extra script, instead of being integrated into a controller that handles user interaction.

  • Autofocus Controller: Turn autofocus on / off while the app is running through a tap with two fingers on the screen. Google currently still recommends using the default setting - which is autofocus off. With this script, you can explore the differences. If the phone camera doesn't support autofocus, it will ignore this setting.
    See script: AutofocusController.cs
    Difference to Original Google example: Starting with the ARCore for Unity SDK 1.8, Google now enables Autofocus by default for augmented images.

General architecture notes

  • Augmented Images: The two pictures to use as markers are in the /Assets/Images/ folder. For the best performance, print them on paper. For quick testing, it also works to show the markers on your computer screen.

  • ArPrefab: Should be part of every AR prefab instantiated in the scene. Stores a reference to the trackable the prefab instance is connected to as a property. Allows for quickly checking which trackables have been given up by the ARCore SDK, to properly clean up the game objects in the scene.

  • TrackingCheck: Regularly checks instantiated prefabs whether the associated ARCore trackable reports that tracking has been lost. Automatically checks all controller scripts that implement the IArObjectController interface. This simple interface allows querying the instantiated prefabs.

  • Light Estimation: Is enabled in this scene and currently used by the nerve cell prefab.

  • Screen Auto-Rotation: Disabled, as this gives a better user experience on Android without screen flickering while turning the screen. Auto-rotation would mainly be needed for static textual content that is not anchored to a plane or augmented image or otherwise placed in screen-space instead of world-space.

  • GLB / GLTF Import: The 3D models of the human heart and nerve cells were imported from GLB files. This format is not yet natively supported in Unity. This app therefore includes the SketchFab unitypackage, which imported the models.

Credits

The 3D models used in this scene have been created by Microsoft: Beating heart, Human heart, Nerve cell.

Released under the MIT license - see the LICENSE file for details.

Developed by Andreas Jakl

About

ARCore sample project that visualizes the human heart on a marker and allows to freely place and transform nerve cells.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.3%
  • ShaderLab 1.6%
  • Other 0.1%