By realbruz
on Tue, 11/13/2012 - 14:59
Hi, I'm new in developing AR app. I can load two different 3d models (virtualbuttons sample) on a single marker but I don't know how to assign them different textures. Both the models load the banana.png. Any suggestions? thanks
loading two 3d models on the same marker with different textures
Hi,
changing the texture applied to a model is done by caling:
glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID);
loading two 3d models on the same marker with different textures
I'm using the samplebutton sample, I need to load two 3d model on one marker, the code below do it. My problem is related to the texture of the second object. It should use a different array of textures.
loading two 3d models on the same marker with different textures
Hi, I would recommend to take a look on VirtualButtons.loadTextures Java method. Once you add new textures there they should show automatically on JNI side too and you can use indices higher than current textureIndex. Which is by default bound to value 4 at maximum.
loading two 3d models on the same marker with different textures
Hi realbruz,
in glBindTexture() you can put whatever texture id you want (so you don't have to use mThisTexture->mTextureID);
suppose you have an array with 10 textures (i.e. with 10 elements of class "Texture"); for each 3D model, you can choose one of those texture,