Home | Spelletjes | Uitvindingen | Gps | Scouting | Meteo | Computers

Ict / Viewing Panoramas In Pm Wiki Menu


It was quite a puzzle to set up panorama viewing in PmWiki, so here a simple tutorial of how I did it.

The core is the Java-applet PTViewer, written bij Walter Dersch. In this article it is explained how to set up the server side. For the user is is left to make Java run in the browser on the client side. In almost all OS-es this is standard, so it will run without problems.

Use this at your own risk. Comments are welcome


You might first want to see the result


First of course, you need to set up a PmWiki install on your site.

The root directory of your pmwiki install is referred to as pathtopmwiki/ throughout this document.

Then you need to install from the cookbook:

And you will need for the java-part:

Extract BigApplet&Application/ptviewer.jar and place it in the pub-directory.

If done correctly, you will have installed the files:

  • pathtopmwiki/cookbook/applet.php
  • pathtopmwiki/cookbook/extlinkedres.php
  • pathtopmwiki/cookbook/ptviewer.php
  • pathtopmwiki/pub/ptviewer.jar
  • pathtopmwiki/pub/extlikedres.js

In pathtopmwiki/local/config.php add the line


And you are ready to go.

Setting up a Panorama page

Here is a sample code to include in your page:

(:ptviewer Attach:mypanorama.jpg width="500" height="375" pan="-90" tilt="5.0" fov="40" auto="0.1":)

In this case the file mypanorama.jpg is viewed in a 500x375 pixel box.

The arguments pan, tilt and fov stand for initial horizontal position, initial vertical position, and initial zoom. The values for these are obtained by setting the panorama in the desired start-position by moving the arrow-keys and then press 'v'. The values can then be read in the browsers status bar.

The argument auto is the initial rotation speed. 0.1 is a fine value, but it is highly dependent of the speed of the browser.

Advanced example

Hot-spots are red balls that come up on a specified position in the panorama when you press the space-bar. To obtain this effect add the following between the brackets in the ptviewer-command.

hotspot0="x1500 y900 n'A comment comes here'"

Places the comment in the status bar when you move over this red ball with your mouse. The x and y-coordinates are obtained using The Gimp.

Even more advanced:

hotspot1="x700 y1200 n'Some other comment' u'pmwiki.php?n=Pan.Picture2'"

Will load the page Pan.Picture2 if clicked on the hot-spot.

Limited panoramas

If your panorama is not 360 degrees round, I add:

panmin="-175" panmax="175"

Or any other value less then 180. The value is not critical. (I usually tend to forget measuring the actual degrees when I make a partly panorama.) This will prevent the viewer to stop panning at the borders.

All Combined

This commands displays your panorama with two hot-spots:

 (:ptviewer Attach:mypanorama.jpg width="500" height="375" \
   pan="-90" tilt="5.0" fov="40" auto="0.1" \
   hotspot0="x1500 y900 n'A comment comes here'" \
   hotspot1="x700 y1200 n'Some other comment' u'pmwiki.php?n=Pan.Picture2'" \

More options can be used, here is a full overview.

Notes on creating Panoramas

Making panoramas is very easy. I use a standard digital camera, set in automatic mode, and make about 12 pictures over 360 degrees. The pictures must have some overlap.

For stitching I use the tool Hugin, using standard settings. In 90% of the cases this gives me an acceptable panorama. If it is no good, I just go out again to make another set. The latest version of Hugin also supports resizing and exporting the resulting panorama, so further processing with The Gimp is not necessary.

More examples

See my panorama-pictures again, but this time add ?action=source behind the URL to see the simple source code.

This article is fully revised after major changes due to PmWiki become compatible with php5.5