theWorld is definited global:
public class ThreeDSimApplet extends Applet implements Runnable, KeyListener, MouseListener {
.
.
.
FrameBuffer buffer=null;
World theWorld;
TextureManager texMan=null;
private Camera camera=null;
.
.
.
public void init() {
theWorld=new World();
.
.
.
I've followed your steps: I've moved ferito's definition and "adding to the world" into loadFerito() as follow:
public void loadFerito(String name, float x, float y, float z){
Object3D ferito=null;
texMan=TextureManager.getInstance();
texMan.addTexture(name+".jpg",new Texture(getDocumentBase(),"textures/feriti/"+name+".jpg"));
Object3D[] feritoArray=Loader.load3DS(getDocumentBase(),"3ds/"+name+".3ds", 20f);
ferito=feritoArray[0];
ferito.setCenter(SimpleVector.ORIGIN);
ferito.translate (x, y+50, z);
ferito.rotateX((float)-Math.PI/2);
ferito.rotateMesh();
ferito.setRotationMatrix(new Matrix());
ferito.createTriangleStrips(2);
ferito.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
ferito.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
ferito.enableLazyTransformations();
theWorld.addObject(ferito);
}
Now I have not a null expection....but none "ferito" is displayed even if correctly loaded.... I'm becoming crazy :shock: