Skip to main content

3D Distortion Hotspot Images

This is the documentation for Pano2VR 4. You can find the new documentation for Pano2VR 5 here.

In this tip, we demonstrate how to create animated point hotspots using 3D distortion. In our example, when the mouse enters the hotspot area, the doors transition from closed to open. Below, we will outline how to do this.

Download the project files.

Create the roll over effect[edit]

Create the panoramas[edit]

  1. Shoot the panorama. Shoot two versions of the panorama. Unless you will have hotspots in every direction, you only need to take one panorama with multiple versions of a direction. In our example, we have one image with the doors closed and another with the doors open.
    Doors open
  2. Stitch the panorama. We are using PTGui. To make this processes easier, you just need to replace an image:
    1. Save the stitched panorama and create it. Name it according to it's action, i.e. pano_mouse_enter.jpg.
    2. Go the Source Images tab and select the image to replace.
    3. Click, Replace. Add the alternative image.
  3. Output the panorama and save the project.

◊ TIP: When naming the panoramas include, mouse_enter (or the like) and the other mouse_up (or the like) to help distinguish between the two versions.

Extract a patch and a hotspot[edit]

  1. Open Pano2VR.
  2. Go the Settings/Preferences. Open the Advanced Tab Select, Add position to file name for the Patch setting.
  3. Close Pano2VR to restart it.
  4. Import the Mouse Enter or Roll Over panorama. In our example, this is the image with the doors open.
  5. Open the Patch Tool.
  6. Frame the patch of the roll-over area. Try to get the area of animation so that it fills the patch window.
  7. Extract the patch.
  8. Find the patch's center. An even number will work best. If your patch is not even, open the patch and adjust the FoV a few points to achieve the size you want. In our example, our patch is 344x344.
  9. Save and close this project.
  10. Open a new Pano2VR project and add the mouse up panorama. In our example, this is with the doors closed.
  11. Add a point hotspot. Anywhere on the pano is fine because in the next step, you'll add the pan, tilt and field of view values manually
  12. Find the patch you extracted. The file name includes it's position values. (p = pan; t = tilt, r = roll, f = field of view)
  13. Enter these values in the Hotspot List of the Hotspot Editor.
  14. Save the project.
  15. Add an HTML5 output.
  16. Open an existing skin or a new skin.
  17. Drag in the patch image to the Editor.
  18. Change it's position to X = 0; Y = 0, in the Position section of the Tree.
  19. Add a hotspot template.
  20. Place the template in the center of the patch image. Divide the patch image's width in half and enter this number for it's position. In our example, X = 172; Y = 172.
  21. Make the patch image a child of the hotspot template.
  22. Select the hotspot template and open it's properties.
  23. Enable 3D Distortion.
  24. Set the template's distance using this formula: panorama width / 2 / 3.1415. For example, 6000/2/3.1415 = 954.4 .

Create an active area[edit]

Because the image is a hotspot, you can't click and drag in this portion of the panorama. We also don't want the image to show all the time; only when the mouse rolls over the door. To fix this, we need to create a active area.

In the skin editor:

  1. Select the image and in it's Appearance section, Set Alpha to 0.
  2. Draw a rectangle over a portion of the hotspot image.
  3. Set the rectangle's Alpha to 0.005. This keeps the rectangle active in Flash while being invisible.
  4. Make the rectangle a child of the template and keep it above the hotspot image.
  5. Add the following actions to the rectangle:
    Source = Mouse Enter; Action = Change Element Alpha; Alpha = 1; Target = patch image
    Source = Mouse Leave; Action = Change Element Alpha; Alpha = 0; Target = patch image

Blend the patch image[edit]

The patch image might differ from the panorama and therefore needs to be blended to match. There are few ways to do this so we'll go over some.

Using PNG[edit]

  1. Open the patch in an image editing software (Photoshop).
  2. Add a layer mask.
  3. Blend out (erase) the edges using the brush tool.
  4. Save as PNG-24. (File > Save for Web).
  5. Open the Pano2VR project (from above).
  6. Open it's skin.
  7. Select the patch image.
  8. In the image properties, click Change... to replace the image. Select the updated patch image. Make sure Format is set to PNG.
  9. Save the project and re-output.

Unfortunately, using the PNG format will generate a large file size. This would not be ideal if the project already contains a lot of elements.

Using JPEG[edit]

For a smaller file size, use JPG for the blended rollover image.

  1. Open the working project (from above).
  2. Open the patch editor.
  3. Enter the position details of the original patch (i.e. doors open image from above).
  4. Extract the patch.
    There should now be two patch images. One for the mouse up and one for the roll over (or mouse enter).
  5. Open this new patch (mouse up) in Photoshop (or your favorite editor).
  6. Drag the roll over patch on top of the mouse up patch (the new one) and line it up.
  7. Mask out the edges of the upper later (mouse enter).
  8. Save as a JPEG.
  9. Replace the old patch in the skin using the same steps as above. Just make sure the image output is JPEG.

Load them externally[edit]

  1. Open the skin (same one that's been used in all previous steps).
  2. Add an External Loader.
  3. Change its position to X = 0; Y = 0.
  4. Change its size to match the patch image. (In our example it would be 344x344)
  5. Change its ID to match the patch image. (In our example, we used the default ID of Image 1.)
  6. Make the External Loader a child of the Hotspot Template
  7. Move the rectangle up the tree so it's above the external loader.
  8. Remove the patch image. The external loader is the taking the place of the patch image.
  9. Select the external loader and change its Alpha to 0 in the Appearance section.
  10. In the External loader section, define its URL. Enter the file name of the roll over (mouse enter) patch image. For example, rollover.jpg.
  11. Save the skin
  12. Output the project.

See also[edit]

3D Distortion Examples
Add External Image or SWF
Skin Editor
Patching Images (Pano2VR)