Mouse picking

Ok, I have been looking for mouse picking in JME3, but found only tutorial for simple picking (always picks in the middle of the screen). How to extend this to pick where user clicked with a mouse on the screen (I don't really know where to get x,y coordinates of a mouse when user clicks)?

Create a mouse axis listener, store the mouse location when events occur and then check for the click like its done here in the scenecomposer of jMP:



http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3-gde/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java



http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3-gde/jme3-core/src/com/jme3/gde/core/scene/SceneCameraController.java



Cheers,

Normen

Whoa, thanks for that… :slight_smile: