Skip to content

Unity AR demo using ViSP

Fabien Spindler edited this page Apr 6, 2020 · 8 revisions

1. Using ViSP Unity wrapper in Unity engine

This project contains in unityProject folder 2 demos that illustrate ViSP Unity wrapper usage. From here we suppose that you followed the previous tutorial that shows how to build ViSPUnity plugin.

  • Start Unity engine and Download the unityProject from the repository and open it in Unity engine.
  • The generated dll (ViSPUnity.dll) should be pasted in the Assets folder.
  • AprilTag can be downloaded from here.
  • You should have a similar Unity window opened, as shown below:

There are 2 projects:

  • AprilTag based Augmented Reality
  • Model-based Tracking

AprilTag based Augmented Reality

For the first project, go to the folder Scenes and open "scene_ar".

  • You should have a similar Unity window opened, as shown below:

  • Click on the 'Plane' GameObject in hierarchy and put in the values for your camera resolution in the inspector window:

  • Notice that the gameObject 'Cube' is a child of gameObject 'Cube_pivot'. This is done to make sure that the cube rotates about the centre of one of the faces.

  • The current implementation takes care of position, scaling and rotation of cube. A small YouTube Video demonstration is also available here.

Model-based Tracking:

For the second project, go to the folder Scenes and open "scene_mbt".

  • You should have a similar Unity window opened, as shown below:

For this project demonstration, we are using a 12.5cm x 12.5cm x 12.5cm cube made from cardboard. An AprilTag (8cm x 8cm) is pasted on one of its faces for initialisation of tracker. Here is a photo for reference:

  • First, click on the 'Plane' GameObject in hierarchy and put in the values for your camera resolution, select the tracker type and select edges visibility in the inspector window:

  • Now, click play button to start. A small YouTube Video demonstration is also available here.
Clone this wiki locally