Benutzer:Georg-Johann/JavaView

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen

JavaView is a Java-applet based software than can be used to render many mathematical surfaces like the Möbius Strip, the Klein Bottle or Boy's Surface (an immersion of the projective plane into Euclidean 3-space) on the fly. Many properties can be adjusted and will be rendered in real time. This includes properies of the very mathematical objects as well as properties of the surface like color and properties of the rendering like spotlights, viewing angle etc.

Unfortunately, modern browsers dropped the support of Java applets, and porting the software 1:1 from Java to newer technologies like HTML5 would be heck of a work. JavaView provides a downloadable version of the software, but its capabilities are lagging far behind what the online version could do.

Fortunately, a Java installation brings a tool called appletviewer which extracts information from the <applet> tag of a web page like PaSurface_MoebiusStrip.html and runs that applet. However, feeding that or similar URLs into appletviewer won't work for some reason. But downloading the required files, I managed to get it to work.

Required Software

[Bearbeiten | Quelltext bearbeiten]
appletviewer
This is contained in Java installations like JRE (Java Runtime Environment) or JDK (Java Development Kit). OpenJDK 1.8 works for me. appletviewer is needed to run the JavaView applet.
JavaView
In order for the applet to run properly, you need several JavaView JARs (Java ARchives) and images that can be downloaded using the following shell script. Notice that the script uses curl which usually has to be installed by hand. Make a new folder, and from within that folder run the script. Don't forget to set the executable flag before running the script, e.g. with
chmod +x <script-name>
#!/usr/bin/env sh

# Download some files so that you can run JavaView locally by means of
# > appletviewer demo/surface/common/PaSurface_MoebiusStrip.html
# provided everything goes well.  The total download size will be 2.6 MiB.

# Downloading from domain...
domain=http://www.javaview.de

files='
       demo/surface/common/PaSurface_MoebiusStrip.html
       jars/javaview.jar
       jars/jvx.jar
       jars/vgpapp.jar
       rsrc/jvScenegraph14.gif
       rsrc/jvToolbar16.gif
       images/JavaViewLogo.gif
       images/jvTextureDijkstra.gif
'

for f in $files; do
    echo "Downloading $domain/$f ..."

    # Download, overwriting stuff if it already exists.
    # Also create subdirs like 'jars/' on the fly.
    curl --progress-bar --create-dirs "$domain/{$f}" --output "#1" 
done
If you don't like running scripts or do not have sh and curl available, then you can alternatively download the files by hand. To that end, download the files listed in the script above into a new folder preserving the directory structure.

Running the JavaView Applet locally

[Bearbeiten | Quelltext bearbeiten]

After the files have been downloaded and appletviewer has been installed, run

appletviewer demo/surface/common/PaSurface_MoebiusStrip.html

On Window-ish systems, use \ as dir separator instead of /.