Log in or register to post comments

is there a fix order to load Texture ?

March 5, 2012 - 6:54am #1

Hi all,
Now I could replace the teapot to a banana in imagetargets, but the banana's Texture is mess ,so I found the source in ImageTargets.java is

mTextures.add(Texture.loadTextureFromApk("TextureTeapotBrass.png",
getAssets()));
mTextures.add(Texture.loadTextureFromApk("TextureTeapotBlue.png",
getAssets()));
mTextures.add(Texture.loadTextureFromApk("TextureTeapotRed.png",
getAssets()));

how could I change the Texture for banana? the order for loading Texture is fix (brass-->blue-->red )?

Re: is there a fix order to load Texture ?

March 5, 2012 - 11:55pm #3

Thanks Robertross , did you mean the "PNG" file is not for the texture ?

Re: is there a fix order to load Texture ?

March 5, 2012 - 7:03am #2

You'll want to load a banana texture into the mTextures vector then add a statement to your render thread in ImageTargets.cpp

if (strcmp(trackable->getName(), "chips") == 0)
        {
            textureIndex = 0;
        }
        else if (strcmp(trackable->getName(), "stones") == 0)
        {
            textureIndex = 1;
        }
        else if (strcmp(trackable->getName(), "myBananaTexture") == 0)
        {
            textureIndex = 3;
        }
        else
        {
            textureIndex = 2;
        }
Log in or register to post comments