I have a simple solar system consisting of two planets and a sun. I can now map images to spheres, but I want to map an animated gif to a sphere. I assumed this would be the same code, but when I load the animated gif, it simply plays the first frame and doesn't animated through the other frames.
The code that loads the image
Texture tex = null;
File img = new File("src/images/earth.jpg");
try {
tex = new TextureLoader(ImageIO.read(img)).getTexture();
} catch (IOException e) {
e.printStackTrace();
}
tex.setBoundaryModeS(Texture.WRAP);
tex.setBoundaryModeT(Texture.WRAP);
TextureAttributes texAttr = new TextureAttributes();
texAttr.setTextureMode(TextureAttributes.MODULATE);
Appearance ap = new Appearance();
ap.setTexture(tex);
ap.setTextureAttributes(texAttr);
------
Node earth = new Sphere(earthRadius, primflags, 100, ap);
Am I missing something obvious? Any help or pointers would be fanatics. If I have failed to give enough detail, please ask and I will be more than happy to supply more code.