ARToolkit with VRML on MacOSX

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???

12 responses to “ARToolkit with VRML on MacOSX

  1. Hey! That is a really good step-by-step ARToolkit for Mac!
    I understand what you are trying to say for terminal commands, but can you please give me a link for openvrml for mac? I only see openvrml for Windows and not on Mac.
    The only openvrml that I ‘see’ on Mac section is in the old versions of ARToolkit for mac.

  2. That was some wonderful research you did (in Japanese!).

    Your blog helped me fixed simpleVRML issues that I spent all morning trying to solve on other forums and websites. Now I can move on to more fun topics.

    Thank you.

  3. Hi, when i try to do the step 4:

    cd ~/Desktop/ARToolKit/examples/simpleVRML
    make

    this is the result:

    cc -L../../lib -L/sw/lib -o ../../bin/simpleVRML object.o simpleVRML.o -lARvrml -lARgsub_lite -lARvideo -lAR -lopenvrml -lopenvrml-gl -lstdc++ -ljpeg -lpng -lz -lm -framework Carbon -framework QuickTime -framework GLUT -framework OpenGL -framework AppKit -framework Foundation -lobjc
    ld: warning: directory ‘/sw/lib’ following -L not found
    ld: library not found for -ljpeg
    collect2: ld returned 1 exit status
    make: *** [../../bin/simpleVRML] Error 1

    any suggestions?
    Thanks!

  4. …mh for me it does not work. I made more symbolink links (also on libpng, libjpg…) but at the end I get a lot of errors like “ld: warning: in ../../lib/libARgsub_lite.a, missing required architecture x86_64 in file”, “Undefined symbols: … symbol(s) not found
    “. Pity.

  5. Uao now it works! For me my last step had been to link libraries in /usr/lib instead of /opt/lib . A “make clean” helped also, and a “./Configure” in the beginning made me choose different options… finally I answered ‘no’ to the hardware questions.
    but at the end… now my videocamera is on and I’m going try to use it!
    5-6 hours lost on this issue.

    • When I try to run ./Configure they say “Permission denied” on my terminal!!! I don’t know what to do anymorešŸ˜¦ It’s been HOURS and I have a project to do… Please help

  6. I have succesfully installed ARToolkit with openVRML. It works, but no textures are shown. I am using the simpleVRML example to try this with the bee and flower .wrl file.

  7. I know this is an old post but I went through everything you said and had the same error as oiram. I googled and installed libjpeg (took me so long to figure out how to install it) and I’m still getting an error:

    Ld bin/simpleVRML.app/Contents/MacOS/simpleVRML normal i386
    cd /Users/sklare/Desktop/ARToolKit
    setenv MACOSX_DEPLOYMENT_TARGET 10.7
    /Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/sklare/Library/Developer/Xcode/DerivedData/ARToolKit-dxrpxbpsvyykgrcdeevwdhpjvdwu/Build/Products/Development -L/Users/sklare/Desktop/ARToolKit/lib -L/sw/lib -F/Users/sklare/Library/Developer/Xcode/DerivedData/ARToolKit-dxrpxbpsvyykgrcdeevwdhpjvdwu/Build/Products/Development -filelist /Users/sklare/Library/Developer/Xcode/DerivedData/ARToolKit-dxrpxbpsvyykgrcdeevwdhpjvdwu/Build/Intermediates/ARToolKit.build/Development/simpleVRML.build/Objects-normal/i386/simpleVRML.LinkFileList -mmacosx-version-min=10.7 -framework Cocoa -framework Carbon -framework GLUT -framework OpenGL -framework QuickTime -lAR -lARgsub_lite -lARvideo -lARvrml -ljpeg -lopenvrml -lopenvrml-gl -lpng12 -lboost_thread -lstdc++.6 -o /Users/sklare/Desktop/ARToolKit/bin/simpleVRML.app/Contents/MacOS/simpleVRML

    ld: warning: directory not found for option ‘-L/sw/lib’
    ld: library not found for -lopenvrml
    Command /Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

    Any ideas as to what could be causing this one? Is it still libjpeg? Did I not install it correctly?

    Thanks!

  8. Hi, when i try to do the make of 4:
    cd ~/Desktop/ARToolKit/examples/simpleVRML
    make

    This is the result:
    cc -L../../lib -L/sw/lib -o ../../bin/simpleVRML object.o simpleVRML.o -lARvrml -lARgsub_lite -lARvideo -lAR -lopenvrml -lopenvrml-gl -lstdc++ -ljpeg -lpng -lz -lm -framework Carbon -framework QuickTime -framework GLUT -framework OpenGL -framework AppKit -framework Foundation -lobjc
    ld: warning: directory not found for option ‘-L/sw/lib’
    ld: library not found for -lARvideo
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [../../bin/simpleVRML] Error 1

    An idea, thanks.

    Jean Michel REVEILLAC

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s