Question

I want to implement indoor navigation through image recognition using Vuforia tool which works collaboratively with Android SDK.

I have collected the images that I want to use and now I have succesfully replaced the default picture of ImageTargets appication so as to add my own pictures.

My problem is the step further, since when this application recognizes a museum exhibit diplays a teapot.I want to replace this teapot with arrows that will help museum users to navigate into the museum.

How can I do it?There is an article to the official website of Vuforia which partially clarifies what must have happened but it's far from comprehensive(https://developer.vuforia.com/resources/dev-guide/replacing-teapot).

Any help might be totally crucial for me Thank you in advance

Was it helpful?

Solution

The first step is to create your arrow models in a program such as Blender or Autodesk Maya and export it as a Wavefront OBJ file. You may have to tweak some plugins/settings in your chosen modelling software to enable that option.

Then you need to convert that .obj file to a C/C++ include file (.h) to work with the native code in ImageTargets.cpp. There is a convenient Perl script that you can download to make this process easier - OBJ2OPENGL.

Then it is a matter of importing your new model in ImageTargets.cpp, e.g. #import "arrow.h" then replace the code to draw the teapot with the following:

// set input data to arrays
glVertexPointer(3, GL_FLOAT, 0, arrowVerts);
glNormalPointer(GL_FLOAT, 0, arrowNormals);
glTexCoordPointer(2, GL_FLOAT, 0, arrowTexCoords);

// draw data
glDrawArrays(GL_TRIANGLES, 0, arrowNumVerts);

Don't forget to rebuild the project using ndk-build when you're finished.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top