Code for Chapter 7

This is the code for Chapter 7. It comprises two parts: HawkNL code (Version 01) for sending DIS packets, and an X3D example scene (Version 01) that shows the results.

HawkNL

HawkNL is a cross-platform abstraction for networking functionality. We used version 1.68 in our example. The code project is build for Visual Studio 2005, though HawkNL supports earlier Microsoft compilers, so the example should work fine if you want to convert. The code is also cross-platform, though we use VC++ for our own code. Please contact the authors if you have problems using it on other platforms.

To compile and run the code you need two files from HawkSoft:

You should unzip these, and the boids-HawkNK_XX.zip in the same directory, so that it has the following contents:

  • boids-HawkNL
  • HawkNL1.68
  • HawkNL168bin

You can then compile the example solution in boids-HawkNL and run the executable. It uses multicast, so there is no connection set up, and this part of the code can be left running.

X3D

The X3D code is a simple example for X3D. Not every X3D browser supports the DIS functionality. We have checked the code in Xj3D, but any browser supporting the X3D Immersive Profile, should work. The ZIP file also contains the source for the other X3D mini examples in Chapter 7.

Because it also contains some functionality for working directly with DIS we recommend opening the files in X3D Edit. We used X3D version 3.2. The file to load is BoidDISReceiverFlock.x3d.

Note that in some builds of X3D Edit 3.2 running on Windows XP (at least), there seems to 
be a problem loading the scene file. It indicates that it can't inline prototypes. If when you
load the scene you don't see any checkboard ground plane, this is likely what happened. A
quick fix is to move all the files in the zip file to the directory
<place where you installed X3D-Edit3.2>\x3deditor32