MouseDrag and Canvas click projected onto plane


I have been getting increasingly frustrated trying to implement this functionality. Basicly what I want to make a method that performes picking, and in the case there is no picking event, projects the click on the canvas onto a plane in the environment. I have done this in Java3D before and it was very easy, relying simply on mouseClick( MouseEvent evt ) and mouseDragging( MouseEvent evt ) for triggering the event, getting the canvas pixel locations from the evt object and calculating an equivalent “eye” location using a simple native method.

I have been trying to do the same in JME, but I keep on running my head against the wall…

  • The closest I have found to a mouseDragging implementation is the MouseAxisTrigger which is too tedious for my taste, requiring four triggers and it only supplies displacements, not absolute location on the canvas which is what I need. Any alternatives? I would prefer a much more general mouse event structure.
  • Are there no examples of picking, not using aim picking ( where the camera location and direction is used to calculate the collision ray )?

    Hope you can help.


Short as your reply was, it was actually quite helpful…


Damn, sorry, I should have checked the forums better.

Your reply here: solved my problem in 2 mins. I set up a raw input listener, and I am in full control of the input now.

Much appreciated!

1 Like