Serving and Viewing
OFF 3D Object Files

Now you can embed links to OFF 3D Object files in your Web pages (just like you can embed links to GIF files) and you can get your client (Netscape|Mosaic|etc.) to automatically invoke viewObject to view them (just as it automatically invokes xv to view GIF files).

The OFF format has several files associated with the description of one objects.

I have added the following extensions

The preView_3d system is a viewer for 3D OFF objects. The page where you came from (preView_3d homepage) contains a list of features the viewer supports as well as examples of objects.

This page gives you instructions for serving and viewing OFF files via the Web based on the assumption that you are using NCSA's httpd server If you can tell me how to amend our instructions for other Web servers and browsers, please let me know at: gaitat@vnet.ibm.com.

Installing viewObject as an External Web Viewer

You can install viewObject on your Unix workstation and tell your Web browser to invoke it as an external viewer for OFF files (just as it invokes xv to view GIF files). Just follow these five steps:

  1. Get the source from ftp://ftp.x.org/contrib/pex/pexView_3d-1.2.tar.Z.

  2. Enter the command "zcat pexView_3d.tar.Z | tar xf -".

  3. Enter "make IBM" of "make HP" or "make Sun" depending on what machine you are on. If everything went well, you should have several executables ready including viewObject in whereyouinstall/pexView_3d/viewObject/viewObject. viewObject is only a script and you need to change its first line depending on where you installed. I would also suggest not moving things around but making a link from somewhere in your path to the viewObject script.
    ln -sf whereyouinstall/pexView_3d/viewObject/viewObject viewobject, should do the trick.

  4. Add the following line to the .mime.types file in your home directory
    application/x-viewObject aoff geom bgeom pcol bpcol \
                             vcol bvcol pnorm bpnorm \
                             vnorm bvnorm anim fly_prp fly_vpn
    

  5. Add the following line to the .mailcap file in your home directory
    application/x-viewObject; viewObject -o %s -URL %u ;
    
    NOTE: Be sure the executable viewObject is in your path.
See Lawrence Livermore National Laboratory's WWW Viewer Test Page for information about many different Web media and their viewers.

Embedding Links to OFF Files in Web Pages

You can embed links to OFF files in Web pages in exactly the same way that you would embed links to GIF files. The names of OFF files must have the aoff extension (just as GIF files have the .gif extension). They may have an additional extension if they are compressed.

For example, BOTTLE is an embedded link to an OFF file on my server. It was generated with the HTML text:

   <A HREF="objects/bottle.aoff">BOTTLE</a>
If you've installed viewObject as an external viewer then you can click on this link to make sure that your installation was successful (but first you need to exit your Web browser and restart it after setting up the .mime.types and .mailcap files).

To serve OFF files from your Web server you need to add the following lines to the resource configuration file (often named srm.conf if you are using the ncsa httpd server) for your server, so that these extensions are registered as Media subtypes:

   AddType application/x-viewObject .aoff
   AddType application/x-viewObject .geom
If you embed links to OFF files in your Web pages, you may want to add text telling people that they need to install viewObject to view these files, and you may want to include a link to this page to tell them how to do it.