Error with mouseInput (from Tut) Post 7

Hello! I am new to jme, but not to java.



I am trying to learn how to use JME3 so I am following the beginner tutorials.



Currently I am on this one: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset



when I go to run the file, after the select Display settings, I get this warning and severe error message:



WARNING: Cannot locate resource: Models/Teapot/Teapot.obj

Oct 11, 2010 2:24:14 PM com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.NullPointerException

at jme3test.helloworld.HelloAssets.simpleInitApp(HelloAssets.java:27)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:155)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:147)

at java.lang.Thread.run(Thread.java:619)



Now I just copied and pasted the code several times, I thought it might be the teapot thing, but I commented that out and both the warning and severe message appears. Can anyone help me with this issue?



Also, how can any models be located? I click on the + in Project Assets on the left. Then I click on the + on models, but this folder is completely empty and in fact every folder in the Project Assets is empty. Those folders must not be though because only the teapot model is missing…?



Thanks for any help!

The demo assets are included in the form of a jar file and can be added to the classpath of the project by going to the project properties and pressing “add library” and selecting jme3-test-data.

The assets folder of the project is also added to the distribution project as a jar file and its empty by default, this is where you add your assets.

Cheers,

Normen

normen said:
The demo assets are included in the form of a jar file and can be added to the classpath of the project by going to the project properties and pressing "add library" and selecting jme3-test-data.
The assets folder of the project is also added to the distribution project as a jar file and its empty by default, this is where you add your assets.
Cheers,
Normen



Perfect!

Thanks

I got another problem now, I am working on the exercise and I cannot get the scene to load (see the Ninja+wall+teapot standing in a town)



I tried using the zip method, Nothing shows up except for the Ninja wall and teapot. I tried second method of loading the town directly into the Scenes folder, still only Ninja wall and teapot. Finally, I tried to make main.scene a .j3o, but when I do I get an error message saying:



Error converting main.scene

java.lang.NUllPointerException



This is a screenie of when I try to run the first part of the exercise

I think you might be starting the included version of the hello example, its a known issue. Try renaming your class or package.

Renaming the class fixed it. Norman your two for two :wink:

Another question! Now I am working on the hello input system > https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_input_system



I am getting stuck right away not even able to compile the sample code!



line 43 is giving me an error message, These are line 42 and 43



[java]inputManager.addMapping(“Rotate”, new KeyTrigger(KeyInput.KEY_SPACE),

new MouseButtonTrigger(MouseInput.BUTTON_LEFT));[/java]



The error message is:



cannot find symbol

symbol : variable MouseInput

location: class jme3test.helloworld.HelloInput

new MouseButtonTrigger(MouseInput.BUTTON_LEFT));

1 error



I do have this line of code, since I just copied and pasted, so not sure why it doesn’t work

[java]import com.jme3.input.controls.MouseButtonTrigger;[/java]

Go to “Source”->“Fix Imports” and it should either fix the imports or present you with a list of possible imports (if there is multiple possible classes found in different packages).

1 Like

+1



works