New type of control

Hello,



I wish create a new type of control, a very simple one.

  • I display an object to the center of the display space (0, 0, 0)
  • when I move the mouse, the camera move arround the center of the object (which is the center of the space) like a trackball.



    I know to do it with OpenGL (JOGL), but not with JME. (I have try to modify the ThirdPersonControler but it's a failure, because I have a problem with the terain)

    Could you help me or give me an example ?



    Thank…

There is that and much more done in the input handler for strategy games. You can probably take it apart and use it as an example, or reuse some classes from it. Most of the functionality you want would be covered in classes RotationSphere and MouseSphericalLook with InterpolationAxis2d as an input filter.

Here is the thread for strategicHandler: http://www.jmonkeyengine.com/jmeforum/index.php?topic=5365.0

You could also take a look at GameControls in jME as well.  Conceptually it's very simple and really easy to extend by providing Controller implementations (there's several built-in uses of this as well).

Hello,



thank you for your answers.

This the solution of my problem :


public class TestSouris extends BaseGame {


private Node scene ;
private Camera cam ;

private boolean ClicGauche = false ;
private boolean ClicMilieu = false ;
private boolean ClicDroit = false ;

public final int ClicG = 0 ; // On renomme les variables pour savoir