ARToolkit is a very nice toolkit developed by Hit Lab (New Zealand & US). It offers pretty good performance. However, it seems more fun to try it with VRML rather than just OpenGL codes since it’s easier to get VRML models. However, making VRML work on Mac is a pain – there are very few sites explaining how to do that. The only useful link I got is a Japanese site (wouldn’t have been able to do it without them) where unfortunately the explanation is in Japanese – the UNIX commands are however not in Japanese :( . This is how I managed to do it.

  1. First of all you need to get ARToolkit from the ARToolkit download site. You will be guided to Sourceforge where you can get the toolkit. While you are there, download the openvrml zip file (openvrml-0.16.3-bin-macosx.zip).
  2. Go the the Setup documentation for MacOS. Follow the building ARToolkit instructions. All should be fine except for the VRML part.
  3. For the VRML part (the core of this post), you will probably see that trying to use fink to install mozilla-dev and openvrml4-dev openvrml-gl5-dev won’t work. So we are going to see alternatives to using the fink command.
    • You first need to get Openvrml. This is available  the sourceforge site (if you didn’t download it earlier)
    • Copy the contents of the include of openvrml to ARToolkit’s include folder; the latter should originally only have a folder called AR.
    • Copy or move the contents of the lib file of openvrml and paste it in ARToolkit’s lib folder. You should now be able to build ARvrml as instructed on the ARToolkit MacOS setup site
    • cd ~/Desktop/ARToolKit/lib/SRC/ARvrml
      make

    • Next create some symbolic links (in the ARToolkit lib folder)  coz if you try building now, ARToolkit will complain about missing libraries
    • ln -s libopenvrml-gl.6.0.4.dylib libopenvrml-gl.dylib
      ln -s libopenvrml.6.1.2.dylib libopenvrml.dylib
      ln -s libboost_thread-1_33_1.dylib libboost_thread.dylib

  4. Once this is done, use the makefile to build the SimpleVRML project.
  5. cd ~/Desktop/ARToolKit/examples/simpleVRML
    make

  6. Finally go to ARToolkit’s bin folder to run the executable produced
  7. cd ~/Desktop/ARToolKit/bin
    ./simpleVRML

  8. On running that, simplevrml complaining about some missing things as follows:

    dyld: Library not loaded:@executable_path/libopenvrml.6.1.2.dylib
    Referenced from: /Users/....(hoge).../ARToolKit2.72.1/build/Development/simpleVRML.app/Contents/MacOS/simpleVRML
    Reason: image not found

    • In simple terms, it is saying that it can’t find      in /opt/local/lib. To solve that, create some simbolic links pointing to the missing items (it will probable complain more than once) as follows for each:
    • sudo ln -s ~/Desktop/ARToolKit2.72.1/lib/libopenvrml.6.1.2.dylib

That should work, at least it worked for me!

- – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – -
As for building on Windows, do as the ARToolkit site says: build using Visual Studio .NET 2003. I’ve tried to build it using Visual C++ 6.0: no luck at all. With Visual Studio 2008, it works until you include Vrml where it breaks! With Visual Studio .NET 2003, it works perfectly – note however that that the the include folder of Visual Studio .NET 2003 has no GL subfolder; you will thus need to create that!

Good Luck!

- – - – - – - – - – - – - – - – - – - – - – - — – - – - – - – - – - – -
Names of Visual Studio

The names of the different versions of Visual Studio (from Wikipedia):
* 5.1 Visual Studio 97
* 5.2 Visual Studio 6.0
* 5.3 Visual Studio .NET (2002)
* 5.4 Visual Studio .NET 2003
* 5.5 Visual Studio 2005
* 5.6 Visual Studio 2008
* 5.7 Visual Studio 2010

Why the hell do the 2002 and 2003 have .NET in their name and not the versions 2005 or 2008???