I keep getting an IllegalArgumentException when i try to load my textures, here is the code
[java]
package mygame;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Sphere;
import com.jme3.texture.Texture;
/**
- test
-
@author normenhansen
*/
public class Main extends SimpleApplication {
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
Sphere sph = new Sphere(20, 20, 4);
Geometry geom2 = new Geometry("Sphere", sph);
Material mat_sphere = new Material(assetManager, "Common/MatDefs/Misc/SimpleTextured.j3md");
mat_sphere.setTexture("GrassTexture", assetManager.loadTexture("Textures/GrassTexture.png"));
geom2.setMaterial(mat_sphere);
rootNode.attachChild(geom2);
}
@Override
public void simpleUpdate(float tpf) {
//TODO: add update code
}
@Override
public void simpleRender(RenderManager rm) {
//TODO: add render code
}
}
[/java]
I dont get it, i placed the files in the assets/Textures/ directory and it is png and the name is right. But i have no idea what is wrong. Do spheres have to have something special?