How to make changes to the Qualcomm Vuforia Sample app

I look at topics on the Qualcomm forums, but no luck, as I do not know exactly how to look for what I want.

I am working with an ImageTargets Image for iOS , and I want to change the kettle to another image (rather text).

I already have a render and I got .h using the opengl library, but I can’t figure out what I need to change to make this work, and since it is very simple and I couldn’t make it work, I really didn't dare to try anything else.

Can anyone help me out?

I would embed the code here, but this is a whole project, so I don’t know exactly what to add, if necessary, please let me know.

+6
source share
4 answers

Check out the EAGLView.mm file. There you will have to load textures (images) and 3D objects (you will need to import your .h instead of teapot.h and modify setup3dObjects accordingly).

They are finally displayed by calling the renderFrameQCAR function.

+4
source

If the case is still relevant, here is what you need to do:

  • get the header file for the 3D object
  • get texture image for this object
  • in EAGLView.mm make the following changes:

    • import "yourobject3d.h"
    • add the texture to the texture array Filenames (this should be at the beginning of the EAGLView
    • ultimately take care of kObjectScale (stupidly it was about 3.0f, for one object I had to change it even to 120.0f)
    • in the setup3dObjects method, assign the corresponding arrays of vertices / normals / texture coordinates (check the file "yourobject3d.h" for the correct arrays and naming) to the Object3D * object
    • make this change in renderFrameQCAR

      //glDrawElements(GL_TRIANGLES, obj3D.numIndices, GL_UNSIGNED_SHORT, (const GLvoid*)obj3D.indices); glDrawArrays(GL_TRIANGLES, 0, obj3D.numVertices); 

I believe that this is all ... if you take a look at the Vuforia forum, that is, here: https://developer.vuforia.com/node/2047669

NOTE: default teapot.h has (!) Indexes that are not in the banana.h file (from the comment below), so be careful.

+4
source

Actually, the kettle is not an image. This is a three-dimensional model stored in .h format, which includes the coordinates of the Vertex, Normal, and Texture. You must know OpenGL ES well in order to understand these codes in a sample application.

An easier way to change the 3D model to what you want is to use a rendering engine that makes drawing and rendering easier, and you don’t have to worry about the OpenGL API. I did this with jPCT-AE for the Android platform, but for iOS there is a copy called OpenFrameworks . It has plugins for loading 3D files or MD2 files, and since it is written in C ++, you can easily integrate it with QCAR.

This is a short video of my result with jPCT and QCAR: Qualcomm Vuforia + jPCT-AE test video

+3
source
-2
source

Source: https://habr.com/ru/post/908195/


All Articles