Pano2VR 7.1 Docs / Create Multiple States

Create Multiple States with Patches and 3D Distorted Hotspot Images

Learn how to create multiple states with a Mouse Over effect. We do this by converting an image patch into a point hotspot.

This mouse over effect uses patches to create multiple states of a scene.

In our examples, we show a scene with doors closed and when the mouse rolls over those doors, they show an image with the doors open. To do this, we create 2 versions of the panorama and use only the bits of the panorama that should change. In our case, the doors. This way, you don’t need to use multiple nodes to create this effect which keeps the project light.

There are multiple ways to create a hover effect. The way explained here is using an external image loader which is a good solution for viewing on mobile, especially if there are multiple roll-over images. This way they only get loaded when needed, preventing the mobile browser from crashing.

Use the Project Files to see how the final project will look, or to follow along.

1. Create the Mouse-Over Effect

  1. Take two panoramas of a scene. For example, one with doors open (Garden_roll) and the other with them closed (Garden_up). One of these images will be used as a donor to extract the areas of interactivity.
  2. Add them both to Pano2VR. Decide which image will be the main scene and which you’ll extract from. Our example will use the panorama with the doors closed as the main scene and we’ll extract the open doors from the other panorama.
    Doors Closed
    Doors Closed
    Doors Open
    Doors Open
  3. Select the node to extract from (the donor panorama). We’re using Doors Open.
  4. Open Patches in the Viewer. Add a patch over the area to extract. Make the patch a little larger than the area to be extracted.
    Patch area
    Patch area
  5. For the patch’s image format, choose PNG as this is a web friendly format.
  6. Open List View. Right-click the patch and select, Copy.
  7. Select the starting scene (doors closed) and paste the patch to the list view of this panorama. Right-click in the list view and choose Paste.
  8. Remove the open door scene from the Tour Browser as this is no longer needed.
  9. Select the Patch and in the patch settings, select Point Hotspot for Convert. This is how we create the interactivity.
    Convert Point Hotspot
    Convert Point Hotspot

    ★ Tip: In Viewer’s context menu, select Reload Image this removes the patch. But when you select the hotspot, it shows again.

  10. Add a Web Output and generate the output. Now the open doors will show. But we still have to make it interactive.

2. Add Interactivity

  1. In the Skin Editor, add a Hotspot Template.
  2. Click Add Custom Image Element in the Hotspot Template parameters. This is what will be showing the point hotspot image and is added as a child of the hotspot template.
    Add Custom Image Element
    Add Custom Image Element
  3. Set the Alpha to .01. 0 would be hidden and inactive and .01 is still invisible but active.
  4. Add a Logic Block. Trigger → Mouse Over; Comparison → = ; Value → true; Alpha → 1. Enable transitions to .5 second.
  5. Select Hand Cursor.
  6. Save skin.

3. Blend the Patch

As the project is now, the patch seams are visible. This can be fixed in your image editing tool. Open the patch image in your editor and add a Layer Mask and feather mask the edges. Save the image and it will update in Pano2VR.

4. Keep the Doors Open

Currently, the doors open when the mouse enters and they close when the mouse leaves. But you might want to keep the doors open and add tour node to go inside, for instance.

  1. Remove the Alpha logic block that was added to the External Image Loader element in part 2.
  2. Add an action. Source = Mouse Click; Action = Alpha; Type = Toggle Element Alpha; Alpha = 1, Transition Time = .5.
  3. Save the output.

5. Add Button to Open and Close the Doors

  1. Add a Text box. Give it some text, like, Open All.
  2. Add a variable. vis_image; Type → true/false; Init Value → false.
  3. Add an Alpha Logic Block to the External Image Loader. Trigger → vis_image; Comparison → =; Value → true; Alpha → 1. Enable Transition →.5.
  4. Add an action to the text box. Source = Mouse Click; Action = Set Variable Value; vis_image; ⌐ not.

See also…

Last modified: May 16, 2023