Log in or register to post comments

a question about load the texture file

June 26, 2012 - 8:45am #3

Hi,

   In the sample: ImageTargets, there is only on png file for the teapot'texture ,but my 3d object has there .tag files for the texture, how could I do ?

a question about load the texture file

June 27, 2012 - 8:12am #2

Do you mean TGA files?

The basic steps for adding textures are ..

  1. Add the texture images to the assets folder.
  2. In the main activity class (e.g. ImageTargets.java) find the loadTextures() method. Add additional calls to mTextures.add for each of your image files. Note that the order in which the textures are added determines their order in the native texture array.
  3. In the native renderFrame() method (e.g. in ImageTargets.cpp) find the point at which the texture object is obtained (textures[textureIndex]). Change the texture index to select the desired texture. The indices start at 0, where index 0 is the first texture added in the loadTextures() Java method.

a question about load the texture file

June 27, 2012 - 7:25pm #1

Thanks your reply, my question is:

in ImageTarget.java

 private void loadTextures()
    {
       mTextures.add(Texture.loadTextureFromApk("TextureTeapotBrass.png",
                                                 getAssets()));
        mTextures.add(Texture.loadTextureFromApk("TextureTeapotBlue.png",
                                                 getAssets()));
        mTextures.add(Texture.loadTextureFromApk("TextureTeapotRed.png",
                                                 getAssets()));
     
     
    }

the TextureTeapotBrass.png is the texture for the Brass Teapot, my question is ,if there are several .png testure files for my 3D object, how could I load it?

 

Log in or register to post comments