1

I am able to change image dynamically using this code :

public void changeImage()
    {
       Log.d("debug1", "" + getCurrentScene().getNumChildren());
        ArrayList<Object3D> objectList = getCurrentScene().getChildrenCopy();
        Material material = objectList.get(0).getMaterial();
        for (ATexture texture : material.getTextureList())
        {
            material.removeTexture(texture);
            texture = null;
        }

        Texture t = new Texture("sphereTexture",R.drawable.newImage);
        t.shouldRecycle(true);
              try {
                  material.addTexture(t);
              }
              catch (Exception e){e.printStackTrace();}

    }

Now I want to change image with animation.Please help how to animate sphere.

Biraj Zalavadia
  • 28,348
  • 10
  • 61
  • 77

1 Answers1

0

Try this,

On click of your imageview, add an animation.

Animation fadeIn = new AlphaAnimation(0, 1);
fadeIn.setInterpolator(new DecelerateInterpolator()); 
fadeIn.setDuration(500);

Image.setAnimation(fadeIn);
Parth Bhayani
  • 1,894
  • 3
  • 17
  • 35
  • Thanks for your response. But I am talking about Texture. It is not simple ImageView. Bitmap is loaded on GLSurface using Rajawali Framework. It provides Sphere class to load images on GLSurface. I want to animate that sphere. – Biraj Zalavadia Nov 16 '15 at 07:32