0
votes

I have some questions regarding to js-aruco augmented reality library. First, what I want to do is making an application that, using the computer web cam, identifies some marker (that is showed in front of the camera) and then looks for a virtual object that corresponds to the marker. What I've seen in the js-aruco code are only samples that, after the marker identification, shows a virtual object demtermined by the code. What I'm looking for is something more general, that searchs in some of a database where there are lot of virtual objects and then shows the object that corresponds to the marker. Does someone know if it's possible with js-aruco?

Second, the virtual objects in some js-aruco codes that I've seen are made by Three.js. I want to deal with those kind of 3d models seen in Sketchfab or another, but I don't know how to do this. How Do I convert them to three.js?

As you can see, I'm kind of lost. If you have any clue to give me or have any code sample that does what I want to do, it would be helpful.

1

1 Answers

0
votes

1) Usually the augmented libraries just detects a group of markers and then returns corresponding transformation matrices for you to transform 3D models with. You will have to include your own logic to handle the model-marker relationship, such indexing into a JavaScript object that maps marker ID to models.

skarf.js handles this model-marker relationship for you automatically via an external JSON file. Just specify the marker IDs and the corresponding model file urls to load and skarf.js will load the models automatically when the corresponding markers are detected.

2) Three.js is able to import a variety of formats, such as Collada (.dae), OBJ (.obj), its own JSON format (.js and binary .js) and several others. As long as you have the 3D models in these formats, you will be able to load them in Three.js via its available loader classes.

If your 3D models are not in any of these formats, Three.js comes with exporters for Blender, Maya and Max. Install these plugins and you should be able to export your 3D model to one of the supported formats.

Note that skarf.js handles model loading for you automatically, so you won't have to deal with the Three.js model importing part, if you are using it.

Check out http://cg.skeelogy.com/skarfjs/ for videos, live demos, source codes, examples and documentation.