Using Live Picture's Java applet
This document gives some hints for using Live Picture's Java applet with
SkyPaint to publish panoramas on the Web.
Step 1: Copy the Java code to your web site
First, you must install the Java applet on your web site. Download the
applet from:
http://www.livepicture.com/download/clients/java_viewer3d.html
Then upload the files onto your web server.
Step 2: Setup the Java applet on your Web site
Live Picture thoroughly documents how to setup the Java applet; see their
documentation at:
http://www.livepicture.com/help/developer/java_guide.html
Two important things that the Live Picture documentation does not mention:
Web browsers restrict Java applets from accessing any web sites besides
the web site on which the Java applet resides. This means that you cannot
use the Live Picture applet to display panoramas that are stored on other
web sites.
The Live Picture documentation states that the applet supporte CUBE-type
panoramas, but it does not.
Step 3: Save-As: Live Picture
Convert your panorama into a format that Live Picture can read. Save
As "Live Picture SPHERE/CYLINDER".
For fastest downloads with a little bit of image quality loss, choose
save panoramas that will be published on the Web in JPEG format. You should
also store "master" copies of your panoramas in a loss-less format,
such as "Live Picture CUBE, BMP".
If you want precise control over the compression of your panorama images,
you can do the following:
- Save the panorama in the BMP format
- Open the BMP files into a full-featured image editor, and use its features
to create compressed JPEG versions of the panorama image(s).
- Modify the Live Picture .ivr file using NotePad (or any other text
editor) to refer to the compressed .jpg image file(s) instead of the uncompressed
.bmp file(s).
Using a specialized JPEG compression program (like JPEG
Optimizer) can result in higher-quality, lower-bandwidth panorama images.
Step 4: Upload .ivr and .jpg files
Upload the .ivr and .jpg files onto your web server. Put them in the
same place as the HTML pages that will refer to them.
Step 5: Create a test web page
See the Live Picture documentation for information on creating a test
web page, and for some example pages (use your web browser's "view
source" to see the complete HTML code).
One thing that the Live Picture documentation does not make clear: it
appears that the Live Picture Java applet has a bug that causes it to resolve
relative URLs incorrectly. The problem occurs if you do the following:
- Use a relative url in the <param name=file value="url">
tag inside the HTML file. For example, you might store all panoramas in
a "panoramas/" directory, and use the HTML code: <param name=file
value="panoramas/mypanorama.ivr">
- Now, if the .ivr file refers to an image file in the same directory
as the .ivr file (for example, "mypanorama.jpg", also in the
panoramas/ directory), you would expect that the Java viewer would look
for "mypanorama.jpg" relative to the directory of "mypanorama.ivr".
However, it doesn't-- it will look for a "mypanorama.jpg" in
the same directory as the HTML file.
- To work around this problem, you can either place the HTML, .ivr, and
.jpg files all in the same directory, OR you can use the <BASE> HTML
command to indicate that ALL hyperlinks in the HTML file should be considered
relative to some other directory. For example, <BASE HREF="panoramas/">
at the top of the HTML file, and then <param name=file value="mypanorama.ivr">
would correctly find both panoramas/mypanorama.ivr and panoramas/mypanorama.jpg.
Step 6: Link or embed the panorama into your web pages
The final step is to modify your existing web pages to either link to
the page you created in step 4 or to add the appropriate HTML code to embed
the Java applet directly into your existing web pages.
Troubleshooting
Getting the Java applet working is complicated, because it involves HTML,
Java, and JavaScript, and because Netscape Navigator and Internet Explorer
behave differently from each other (and sometimes behave differently on
different platforms). Here are some troubleshooting tips:
- First, be sure the JavaScript code is working correctly. The JavaScript
code (everything between <SCRIPT> and </SCRIPT> tags in the
HTML file) is run as the web page is being loaded, and creates parts of
the HTML web page on-the-fly, based on which web browser is being used
(Netscape or Internet Explorer). To be sure it is running, add statements
like:
alert("JavaScript running OK, Netscape4 detected");
... to the JavaScript code. If you get stuck, just replace
the complicated JavaScript document.write() calls with plain-old HTML appropriate
for whichever web browser you happen to be using. After you get everything
else setup and working, go back and add the JavaScript back in to support
other web browsers.
- Next, be sure that the Java applet is running. If it is, you will see
the Live Picture logo in the web page. If it doesn't, double-check the
<applet> tag parameters, and be sure you have installed all of the
necessary .java or .jar or .cab files on your web server. And be sure that
your web provider allows Java applets on your web site.
- Finally, if the Java applet runs but cannot locate either the .ivr
file or the .jpg panorama image file, make sure you have installed them
both into the correct directory, and re-read Step 5 above. Also see the
Live Picture documentation for hints about panorama sizes; if your panorama
is too large for the Java applet to display, use SkyPaint's "File->Resize
Panorama" command to make it smaller (but be sure to save the original,
large panorama first!).
| Forward
to Publishing VRML97 | Up
to the tutorial index | Back to Choosing
a Format |
| SkyPaint
| Purchase
| Gallery | Demos
| Tutorials | Support
|
©2005 All rights reserved.
webmaster@skypaint.com