-
Notifications
You must be signed in to change notification settings - Fork 5
Tutorial Interpolation
The Interpolation Redirection Techniques can be used to map a differently shaped virtual object to a physical object. In this tutorial, we will map the virtual greenish rectangle block to the physical white block. If a user touches the surface of the virtual block with the virtual hand the real hand will be redirected to the matching position on the white block.
For this, a few offset connection between the virtual and real-world have to be assigned. This process can be seen in the video below. Each step that is introduced in the video is explained in more detail below the video, for further help.
This image will redirect you to the tutorial video on Youtube.
-
Drag and Drop the HaRT_core prefab into the hierarchy. It can be found in the Assets/Prefabs/ folder.
-
Attach the RedirectionObject.cs script to the virtual object in your unity scene.
-
Setup the virtual object. At least all edges (or other regions of interests) of the virtual object have to be mapped to the physical position. For this we create offsets.
3.1. Drag and Drop the VirtualToRealConnection prefab onto the virtual object to place it as a child object. In the scene view, it is visualized via gizmos. Turquoise means the virtual and real position of the offset are identical. Blue represents the virtual position and yellow the matching real position.
3.2. Set up the VirtualToRealConnection, the transform of this object represents the virtual position of the offset. This means, move the turquoise gizmo sphere onto the virtual position
3.3. Open the VirtualToRealConnection that you have placed. It has a RealPosition child object. Place this object on the matching physical position. The color of the spheres then changes automatically to blue/yellow.
3.4. Repeat this for at least all edges or region of interests.
-
The offsets that you just have placed also manipulate the region around the virtual object. To stop this, VirtualToRealConnections with no offsets have to be placed around the object. Simply Drag and Drop the prefabs around. The gizmo sphere is turquoise.
-
Select all VirtualToRealConnections you have placed in the scene and assign them to the RedirectionObject Positions field on your virtual object.
-
Add an Interpolation Redirection Technique, drag and drop it from the Prefabs folder into the hierarchy.
-
Setup the RedirectionManager, it is a child object of the HaRT_core prefab that is already in your scene. Add the virtual world to the virtual world public field, place the virtual object into the AllRedirectedPrefabs Array and finally, add the RedirectionTechnique on the default redirection technique field.
-
Hit play and spacebar and start your redirection!
)