Hi Egon,
another question/problem….. I’m loading textures in a generic way as follow:
File dir=new File("C:/Programmi/Java_SDK/bin/textures");
String[] files=dir.list();
for (int i=0; i<files.length; i++) {
String name=files[i];
if (name.endsWith(".jpg")) {
texMan.addTexture(name, new Texture(getDocumentBase(),"textures/"+name));
}
}
in init() method. In my previous version I’ve loaded some objs separately from my world in init() method too, as follow:
Object3D[] ferito1Array=Loader.load3DS(getDocumentBase(),"3ds/ferito1.3ds", 20f);
ferito1=new Object3D(0);
ferito1=ferito1Array[0];
ferito1.setCenter(SimpleVector.ORIGIN);
ferito1.rotateX((float)-Math.PI/2);
ferito1.rotateMesh();
ferito1.setRotationMatrix(new Matrix());
ferito1.createTriangleStrips(2);
ferito1.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
ferito1.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
ferito1.enableLazyTransformations();
Now, I’m using a config file where I can decide to load or not the above obj, so I’ve decide to move the above code in another method, defined by myself named loadFerito(). The problem is that when I perform this, the Sun Java Console says:
ERROR: A texture with the name 'ferito1.jpg' has been declared twice!
where ferito1.jpg is the texture associated with ferito1.3ds and the obj in the applet is obviously white.
If I move back the loading/defition obj code into the init() method everything works fine. Any explanation ? Bye and thanks