package edu.worcester.subter.j3d;
import javax.media.j3d.Appearance;
import javax.media.j3d.Material;
import javax.media.j3d.Texture;
import javax.media.j3d.TextureAttributes;
import com.sun.j3d.utils.image.TextureLoader;
public class Appearances {
public static Appearance fromFile(String textureFileName) {
final TextureLoader loader = new TextureLoader(textureFileName, null);
final Texture texture = loader.getTexture();
final Appearance appearance = new Appearance();
final TextureAttributes ta = new TextureAttributes();
ta.setTextureMode(TextureAttributes.COMBINE);
appearance.setMaterial(new Material());
appearance.setTexture(texture);
appearance.setTextureAttributes(ta);
return appearance;
}
}