Computer Graphics and Multimedia Software - Knowledge Sharing

Tuesday, December 14, 2010

How to import VRML model in ARToolkit

Each pattern is associated with an image.
The mapping between pattern and image is found in
C:\ARToolkit\bin\data\vrml_data for simpleVRML.exe program
and C:\ARToolkit\bin\data\multi_vrml_data for the multiVRML.exe program.


For the simpleVRML.exe program, the patterns to be recognized and their associated models are specified in the Data/vrml_data file. In this file you will see a set of lines like this:

#pattern 1
VRML Wrl/bud_B.dat
Data/patt.hiro
80.0 0.0 0.0

In order to import your own model you will have to follow this pattern (Using your_file as example name):

1. Copy your_file.wrl into the Wrl directory

2. Make a your_file.dat file and associate it with your_file.wrl by typing Wrl/ your_file.wrl on the first line. (You may take a copy of one the existing .dat files and edit it to fit your wrl file). Place it in the Wrl directory.

3. Make a new marker (Se section 3.2) or use one that is not yet in use.

4. Edit the Data/vrml_data file by adding a new paragraph:
#pattern 3
VRML Wrl/ your_file.dat
Data/patt.sample1 -- Alternatively your new marker (See on How to make your own marker) 80.0
0.0 0.0

Start the simpleVRML.exe program. When the camera recognizes the pattern associated with your model, the model will be loaded and rendered.


Share:

22 comments:

  1. Hi, I have a question.

    When I try tu compile the simpleVRML.exe it tells me:

    LINK : fatal error LNK1104: cannot open file
    'ARmulti32.lib'

    I'm using the Artoolkir2.65vrml from sourceforge
    and visual c++ 2008 (Windows 7)

    ReplyDelete
  2. That error because of they couldn't find the lib.

    Setting your project properties..u have to set the link to the folder that contains all .lib it required. (just set directly link to the ARToolkit 2.65 folder).

    Configuration Properties >> C/C++ >> Additional Include Directories
    Configuration Properties >> Linker >> Additional Library Directories

    Regards

    ReplyDelete
  3. Hai..
    i successfully run simplevrml using provided .wrl model which is bud_B.

    However when i run using my own model .wrl its unsuccessful. i already change my dat and data file.

    I am using Maya and export it into .wrl .i really dont know what to do.

    or i actually cant use maya to make .wrl model for artoolkit??

    ReplyDelete
  4. Actually doesn't matter about the modeler either Blender, Maya or 3DSMax. ARToolkit still able to read well-converted vrml model unless they are in different format. I don't get what you mean by unsuccessful. Is it producing any errors or they are successful compiled but seems to be no model display?

    ReplyDelete
  5. What i could help here, make sure you place your model inside the right directory. Once you convert your model make sure you know the perspective view and world coordinate they was in. Identify their X, Y , Z correctly. Because sometimes your model has already successful rendered but cannot registered well in the right position it should to overlaid on the marker.

    ReplyDelete
  6. Hai ajunewanis...

    what i mean by unsuccessful is my model not display even though there are no error message.

    how to identify perspective view and world coordinate??

    sorry im new to ARtoolkit..thanx for your help..:)

    ReplyDelete
  7. Mean your model was already rendered but did not appear on the maker. Meaning by perspective view and world coordinate, need to change your position of the object, their scale and translate value and including their rotation degree. It contains in your file.dat

    ReplyDelete
  8. how to make .dat file?????

    ReplyDelete
  9. have u try using maya to develop artoolkit application? my vrml file which i export in maya cannot be displayed in artoolkit..can u show me how to do it step by step? really appreciate your help..

    ReplyDelete
  10. Its about the model need to be confirm its well-converted. After export, try to retrieve back to compare with the original model. Sometimes their meshes already broken and it definitely unmanaged by the loader in toolkit. Kindly let me know the version ARToolkit that currently you use. Is it your model is animated model that contains with rigging?

    ReplyDelete
  11. RE: how to make .dat file?????

    Do refer to my link as follow :

    http://augmented-career-ajune.blogspot.com/2010/12/how-to-generate-marker.html

    I have also provided the Tutorial(.pdf), you may view link as below :

    http://augmented-career-ajune.blogspot.com/2010/12/using-artoolkit-to-develop-augmented.html

    ReplyDelete
  12. i am very new with maya n artoolkit..
    how to know their meshes already broken?
    i am using artoolkit 2.72.1
    i am using animated model..animation of a piston..

    ReplyDelete
    Replies
    1. Dear nwar : you should convert the model and try to view their result before load into ARToolkit.

      Delete
  13. Hello, i successfully import my own model in artoolkit and it renders ok. However though the shape is ok and its placement correct, it appears dark, almost black in color.

    ReplyDelete
    Replies
    1. Dear Blacktrader : Your model perhaps missing the textures or/and problems on the texture mapping..or else it might have default the lighting sources during conversion.

      Delete
    2. Did anybody manage to fix that problem?

      Delete
  14. Hi, you know how to detect animation via ARToolkit? Does that require complex programming? Thanks!

    ReplyDelete
    Replies
    1. Still required a few amendment on the programming part. It didn't much complex.

      Delete
  15. I'm really enjoying the design and layout of your blog. It's a
    very easy on the eyes which makes it much more pleasant for me to
    come here and visit more often. Did you hire out a developer to create your theme?
    Excellent work!

    My webpage: large egyptian statues

    ReplyDelete
  16. hi.. i try this... it just the object can appears. but the textures no. so... how i can put the texture to the box? i already save the textures into the textures file. but still no textures appear. plz help..

    ReplyDelete
  17. I have check online and apparently ARToolKit doesn't like WRL files exported from Maya. I'm trying to export my models with other programs.

    ReplyDelete
  18. Hey there, the sample models are showing up nicely, however when I export one of my models from 3Ds Max into .wrl, configure everything in Artoolkit and show the marker to the camera, only parts of the model appear. Any hints? Thanks in advance.

    ReplyDelete

Malaysia Augmented Reality

Its incredibly difficult to discover the undiscovered. Here will see how I can help you. Cheers - Ajune (comp.utm.my/ajune)
ajune@utm.my. Powered by Blogger.