JME can't see the model i added to the scene

Hello Guys,

I have a Problem. I have a Project where I am trying to code a shooter.

And I have successfully added a world to the Collision System and the rootNode.

Now I have loaded the modell of the first-person view of a weapon i want to use and I add it to

the rootNode too, and set the position to the Cam, but i can not see the Modell when i start the game. I have tried scaling it to different sizes

and the Output of the Application shows no errors. So i have no idea what could be wrong.

Can somebody tell me what could be the Problem ?

Greetings,

J4ever

You added a light?

Yes for the beginning I added a AmbientLight and a Directional Light like in the examples. And I can see the world I am

walking in but I can not see the model (which should be at the players start point).

Maybe it has an offset in the model file? Can you see it in the SDK when converting?

So then something else is wrong and you don’t add the model for some reason. Post your code.

I have converted it already to an .j3o and I can look at it in the scene composer. I also can see it in my assets directory.

I write this in the SimpleInitApp(){



//Logger.getLogger( “” ).setLevel( Level.OFF );



spieler=new Player(this); //my Player Object Handling with the Collision the Health and so on

spieler.initPhysics();

world=new World(); //World Class

world.setUpLight();

world.loadMainBody("/Models/Maps/Dessert Storm/dessert.j3o", 0.4f, this); //the world is loaded and displayed correctly

world.initPhysics();

rootNode.attachChild(world.welt); //add to rootNode

bulletAppState = new BulletAppState();

stateManager.attach(bulletAppState);

setUpKeys();

bulletAppState.getPhysicsSpace().add(spieler.player);

bulletAppState.getPhysicsSpace().add(world.landscape);





weapon = assetManager.loadModel(“Models/Weapons/Schlagwaffen/Axt.j3o”); //the Modell of an Axe





weapon .setLocalTranslation(spieler.player.getPhysicsLocation());

weapon .setLocalScale(0.20f);

rootNode.attachChild(weapon); //add weapon but i can’t see it

System.out.println(“Axe”+weapon.getLocalTranslation());

// I added this Box later to see the Position where it should be

Box box1 = new Box( Vector3f.ZERO, 1,1,1);

Geometry blue = new Geometry(“Box”, box1);

Material mat1 = new Material(assetManager,

“Common/MatDefs/Misc/Unshaded.j3md”);

mat1.setColor(“Color”, ColorRGBA.Blue);

blue.setMaterial(mat1);

blue.setLocalTranslation(spieler.player.getPhysicsLocation());

rootNode.attachChild(blue);



}



I hope this is enough. But in my eyes everything is correctly :frowning:

Do you see it if you don’t set the weapon’s scale? Do you see it if you don’t set the location to the same as the camera? (that code wasn’t included)



It’s possible that it’s too tiny and too close to the camera to be rendered.

I have just set the position of the weapon to the user at the beginning, that means if i move the weapon don’t moves with me for the beginning so i could walk around the weapon. But I don’t know wether my weapon is to big or to small. But I scale the Map at the beginning at the factor of 0.4f an it is quite big. So how much should I scale the weapon ? Is there any tipp for adjusting the size to the maps size ? And I have removed the scaling but i still don’t see it. But when i open the map in the sceneComposer and add the weapon in too it is nearly as big as the map. It is very strange.

Maybe you stand right inside of a huuge sword? :slight_smile: Its backface culled so you might not see it…? Does your player object do anything to the spatial? Like initialization or something?

I have switched the backface culling to never in the sceneComposer and saved it and started but I can not see it and I do not know if there is a maximal Viewing distance so it is maybe out of the range i can see. At the Moment the Player does nothing with it.

OMG!!! Now I realised that i added the light just to my world Node XD I can’t believe it.

@j4ever said:
OMG!!!! Now I realised that i added the light just to my world Node XD I can't believe it.

Hehe.. Its also good to attach the sword to the world node maybe, might be useful to save a "level" for special nodes.

Ok thanks normen, and sorry for stealing your time but i just didn’t know what the problem was.