Experiment: Playing with Vuforia and with Coloured Jars



During my professional experiences I had to work often with Augmented Reality and I found myself using Vuforia, one of the most famous platforms for AR. For this reason I decided to make a short Vuforia experiment, simply based on Image Targets, which I wish to use as a test case for a few Unity scripts still on development. Some of these scripts are used to control LoDs on Curved Poly models int Play mode and will be almost surelly added to Curved Poly - Runtime.

About MushroomsLabs Experiments

Mushrooms Labs experiments are fast development activities, made in 4-10 hours with a clear objective, usually involving the exploration of new technologies or of new tools for Curved Poly or for the Shadow Framework. I usually go straight forward to the goal, and, in the end, try to figure out what I did wrong. I think that if I can learn from my errors, it's worth to share them so that everybody can learn as well as me.

Creating the Database

Vuforia Setup 01

I have these cards of mine, bought 14 years ago when a friends wanted to teach me playing Magic (I kept playing Magic only for a few months ... but that's another story). I though they would have been a good starting point for a great Vuforia experience (honestly? I was wrong, I made some bad choices, as I will show you soon). The idea was to use the images on this cards as a classic Vuforia Image Target on top of which virtual contents can be added to the classic camera background. For this reason I had to:

After creating the DB on Vuforia Developer Portal, I started to realize that I had choosed a bad set of cards, but (for this time) I decided to go ahead with what I had. Next time I'll be on this test case, I will change the cards with better ones. Basically: the images were rated with a low number of stars because most of them are very similar; I should have choosen a more significant set of images, that's all. This kind of tools usually try to find out a set of significant features in the images, and this features must differ in a significant way to make them recognizable.

Vuforia Setup 02

Building the Project with Unity

In order to work with Vuforia and Unity, I had to create a new Unity project and enable Vuforia on the project. This is pretty straightforward, since Unity support Vuforia natively nowadays. Then, I proceeded with a basic setup, which requires to create an Scene with an AR camera and a set of Image Targets. I also integrated CurvedPoly - Runtime in the project and with a small set of prefabs, made with Curved Poly: I used the Salt,Pepper, the Spices and the Jars models. Here you can see a screenshot which shows you how the scene looks in the end.

Vuforia Setup 03

Then, of course, i proceeded with a simple build made on an Android Device. The app asks to access the camera on the device the first time it's launched.

Playing with the Cards

This Experiment was a very easy programming exercise, but still valuable and fun somehow. Moving the device on the cards will change the model shown on them, and you can rotate the card to rotate the model. Here a set of screenshots taken from the App.

Vuforia Setup 02
Vuforia Setup 03
Vuforia Setup 01
Vuforia Setup 04
Vuforia Setup 05
Vuforia Setup 06

Next Step

This is all. Now i can run a set of tests which where I will take measures which I need to balance my models. With Curved Poly you can move from very Low Polygonal Models to very High Polygonal Models, at run time, without having to pay the cost to keep more versions of the same model in your memory App. With Augmented Reality applications you will often move very close to a model, and that's why Curved Poly has a Close option in its default LoDs. That said, it's of utmost importance to understand at which distances it make sense to switch from one LoD to another. After all the tests will be done, I will surely write a main article with all the data and with some important balancing guidelines for your Curved Poly models.