I know the image has to be a power of 2 for both dimensions. My image is 256x256 but the following still throws the illegal image size exception. Is there some bug I should be aware of?
TextureLoader loader = new TextureLoader(path, this);
ImageComponent2D image = loader.getImage();
System.out.println(image.getWidth() + “x” + image.getHeight());
// this prints out 256x256
Texture2D texture = new Texture2D();
texture.setImage(0, image);
// and here I get:
//Exception in thread “main” java.lang.IllegalArgumentException: Texture:illegal image size
at javax.media.j3d.TextureRetained.checkImageSize(TextureRetained.java:400)
at javax.media.j3d.TextureRetained.initImage(TextureRetained.java:345)
at javax.media.j3d.Texture.setImage(Texture.java:940)
at RotationTesterWithTexture.(RotationTesterWithTexture.java:52)
at RotationTesterWithTexture.main(RotationTesterWithTexture.java:65)