3D for Free

The Xaw3d package is available from the X Consortium ftp site or any of its standard mirror sites. Based in /contrib/widgets/Xaw3d/, there are individual directories for R4, R5 and R6.

Building the library is straight-forward; simple, clear directions are provided with the package. To use the library, you have two options. First, you can just install the Xaw3d files in place of the standard Xaw library and include files. This makes Xaw3d your standard GUI library for Xaw-based programs. I recommend this; it's the easiest method, and you can simulate the original Athena look and feel by setting shadowWidth resources in a resource file:

    *shadowWidth: 0

If, however, you need both flavors, you need to install the Xaw3d library separately. In this case, there are two obvious choices:

  1. Clone the necessary imake configuration files and xmkmf (let's call it xmkmf3d) to invoke imake with the new files.
  2. Modify your client Imakefiles to link with the 3d widgets.
The former works well, but you have to be sure everyone knows about it. One way around this is to modify xmkmf to require an argument, say ``Xaw'' or ``Xaw3d'', and complain if it's not there. I don't especially care for this, but some people like it.

The problem with modifying Imakefiles is that Athena widget files are usually included like this:

    #include <Xaw/Thingie.h>
This means your Imakefiles must also modify the #include search path. The INCLUDES variable is intended for just this use.
I then have a link inside /usr/include/X11/Xaw3d for Xaw/ pointing to its parent (..).

To link, then, you can just redefine XawClientLibs (check the XawClientLibs definition for your system).

    #define XawClientLibs -lXaw3d -lXmu -lXt -lX11 -lXext