PTViewer for QTVR

Updated for PTViewer 2.0

Helmut Dersch
University of Furtwangen

updated October 18, 2001

PTMViewer is an extension class to PTViewer, that reads and processes QTVR-panoramas (Cylindrical and Cubic) and object novies without the need for a Quicktime installation. This makes it possible to display QTVR files without downloading the huge Quicktime plug-in. Unlike other extensions to PTViewer, this one needs not be loaded and initialized by HTML-commands, but is automatically called by PTViewer if the filename of the source file ends with the extension '.mov'. PTMViewer in turn uses the extensions PTZoom and PTObject. A minimal installation for viewing QTVR-files must include these three extensions which are packaged in the applet contained in the 'for QTVR' folder of the distribution.

Using PTVewer with QTVR-files is almost identical to using PTViewer with the default image format. As soon as the panoramic image has a filename ending with '.mov', it is assumed to be a QTVR-file and processing is handed over to the appropriate routines. This works with the standalone viewer as well as with applets embedded in HTML-pages. Since PTViewer runs under any Java installation (Version >1.04) this provides a cross platform viewer for QTVR-files for most computers.

Supported Formats and Features

Quicktime supports many internal features, formats and codecs. PTViewer recognizes only a subset, which, however, is sufficient to create VR-tours. More features will be added to future versions.

The current version 2.4 of PTViewer reads single node QTVR files. The following features are extracted from the Quicktime file:



Using PTViewer for QTVR

(a) Adding a Java Version to existing QTVR-tours

To convert an existing QTVR-tour in HTML to PTViewer-format requires exchange of the <embed..> tag with the corresponding <applet..> tag. Suppose the Plug-in version uses this code to display the panorama:

<embed  width=480 height=336 >
Exchanging this with the following lines turns the same page into a Java version:
<applet archive=ptviewer.jar code=ptviewer.class width=320 height=220 >
<param name=file>
The width and height is chosen somewhat smaller to compensate for the reduced speed, but in principle the same viewer size could be used. The applet file ptviewer.jar containing the required classes has to be provided in the same folder as the HTML-page.

If the QTVR-tour uses Javascript functions to load new panoramas into the viewer, you can transfer this functionality to the Java viewer without additional coding. You have to make sure that the plug-in viewer and the java viewer use the same name.
Suppose you have defined this Javascript function to load new panoramas. It is called when the user hits a button or clickable image on the HTML-page:

<script language="JavaScript">
    function loadPano(url) {
// -->
The <embed..> tag for the plug-in now becomes
<embed  width=480 height=336 name=viewer enablejavascript=true>
and this is the <applet ..> tag that provides the same functionality:
<applet archive=ptviewer.jar code=ptviewer.class width=320 height=220 name=viewer >
<param name=file>
Please note that scripting the QT-Viewer is supported only in Netscape browsers. PTViewer may be scripted in Internet Explorer on the Windows platform, too.

Both plug-in and java version of the panorama can be embedded in the same page if a suitable Quicktime detection script is used to set a variable haveqt (for cylindrical panoramas and object movies) or haveqt5 (for cubic panoramas) to either true or false. See Apple's Quicktime website for examples of such scripts, or paste this code into your HTML-page. This Javascript code then loads either the Quicktime plug-in, or the Java viewer.

<script language="JavaScript">
    if( haveqt5 )
        document.write("<embed  width=480 height=336 >") ;
        document.write("<applet archive=ptviewer.jar code=ptviewer.class width=320 height=220 >") ;
        document.write("<param name=file>") ;
        document.write("</applet>") ;
// -->
Any of the regular PTViewer commands can be added to the applet-tag, either to add functionality like controls and buttons, or to override the embedded tags in the Quicktime file.

(b) Authoring suitable QTVR-Panoramas

It is assumed that a spherical image has been created using a suitable stitcher such as PTStitcher or PhotoVista. This image can be converted to cubic Quicktime format using Apple's free utility MakeCubicPPC. Choose PhotoJPEG as compressor for the panoramic image. Hotspots are created as outlined in the QTVR-Hotspot-tutorial. I recommend to create the hotspot image also as one single 360°x180° equirectangular image like the panorama and name it as described in the MakeCubicPPC documentation. When creating the Quicktime file, choose TIFF/packbits as compressor for the hotspot track rather than the default Graphics format. Finally, use PlugInHelper to set user data like pan/tilt/fov-angles and hotspot  data. For an example open any of the Quicktime panoramas in this tour using PlugInHelper and check the entry 'PlugIn-Settings'.

There are a few differences in naming conventions between QTVR and PTViewer format, which are automatically translated, when PTViewer reads Quicktime files. In case the parameters are set manually in the applet tag, they have to be converted by the author:

From version 2.3, PTViewer supports zooming in Object movies. The standard Java scaling functions are used which leave much to be desired in terms of image quality. The default view, ie 1:1 display of source images, corresponds to the default field of view (70°). To start with other sizes, set fov to different values, e.g. 35 for 2:1 enlargements, or 140 for 1:2 reductions. To suppress any zooming capability, set fovmax and fovmin to values close to 70.

Some QTVR-authoring programs change the order of images inside the QTVR-file. E.g., this happens when flattening movies. PTViewer can not detect the right order of images in the files, and always assumes the default order. In this case the correct order of images in the file has to be declared using the 'order' parameter, which is a comma separated list of numbers indicating the image positions, eg
<PARAM name=order value=4,3,1,5,7,2,0,6>

Copyright ©2001 Helmut Dersch