"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Loading textures dynamically

Hello. I'm working on an application that displays some values in empty cases. The empty cases are on the target and they are filled with augmented reality (the augmented objet is a plane and the texture applied on it is a generated .png with the values placed where they need to appear). But the problem is that the values are received dynamically. So i need to reload my texture regularly but I don't know if it's possible. (I modified ImageTargets, so I think if it's possible I will need to use loadTextures, but when ?). Thanks. Adrien.

The initApplicationNative method needs to be called first, to pull the image data from Java into native. You may want to call deinitApplicationNative first to release the previously allocated textures. Then, call the native initRendering method from the render thread (e.g.

You can actually call everything together from ImageTargets.java. Just call the renderFrame method on the GL thread by queuing an event with the glView object.

Consider loading texture data in native code using libpng. I think that one of the reasons why texture data is loaded in java part in the samples, is because they were bundled with apk and prior api version 9 it was tricky to access assets data from native code.

Sure. The Texture class included in the samples uses the AssetManager to open the image file. You could replace this with a different approach that loads the file from elsewhere on the file system. - Kim

AdrienEDF

Thu, 03/15/2012 - 09:03

I tried bu not succeeded ... Is it possible not to use the method with the AssetManager only for one of my three images ? I don't find how to make my image on the SDCard a "Texture". Thanks. Adrien. EDIT : i think I have just solved my problem.