Log in or register to post comments

Why do we load textures in the Android App

April 9, 2013 - 11:28pm #1

Hi,

Wants to know why are we calling loadTextures() function in onCreate().
and adding the texture object to the mTextures vector.

Plase Explain the functinality of the loadTextureFromApk() method.

Thanks:)

Why do we load textures in the Android App

April 10, 2013 - 9:21am #4

No, they don't play any specific role with the trackables; those textures are only used for rendering the Teapot 3D model.

 

Why do we load textures in the Android App

April 10, 2013 - 1:31am #3

Thanks for explaining. One more question, that why we require this textures?

Will this textures play any role when I create my own image dataset?

Why do we load textures in the Android App

April 10, 2013 - 12:17am #2

Hi, as the name implies, the loadTextures() and the loadTextureFromApk() methods load textures (images) from a few files which are stored on the device;

the reason why we load them in the onCreate() method of the activity, is because we want them to be available in memory as soon as possible, since we then copy those textures from Java to native (C++) in the iniApplicationNative() function.

Note: the initApplicationNative() function is called from the initApplicationAR() method in ImageTargets.java, and the code is defined in ImageTargets.cpp.

Then, why do we copy the textures from Java to C++ ?

Because we use the C++ textures to create and initialize OpenGL textures (see the function initRendering() in ImageTargets.cpp). The OpenGL textures are then used for rendering the Teapot 3D model.

 

 

Log in or register to post comments