Hello , its me again
i add mouselistener and keylistner to my project
and with System.out.println(“Mouse X”+mx+" Y"+my);
i see that it working over the canvasjogl thing…
my question… how can i use the vars from the
mouseMoved function (mx,my) inside the
display function where my 3d stuff is.
much thanks
public class FSO extends JFrame implements WindowListener,MouseListener,MouseMotionListener,KeyListener
{
...
public FSO()
{
...
...
GLU glu = new GLU();
canvas = new GLCanvas(cap);
canvas.addGLEventListener(new SceneView());
getContentPane().add(canvas);
this.addWindowListener(this);
canvas.addMouseListener(this);
canvas.addMouseMotionListener(this);
canvas.addKeyListener(this);
}
class SceneView implements GLEventListener
{
...My 3d stuff is here..perfect
public void init(GLAutoDrawable arg0)
{
public void display(GLAutoDrawable arg0)
{
...
HERE i NEED the Mouse X and Y Data and such things from
the mouselistener, how can i import the int mx/ int my from function
below (mouseMoved) to use here??
}
}
@Override
public void mouseMoved(MouseEvent arg0) {
// TODO Auto-generated method stub
int mx=arg0.getX();
int my=arg0.getY();
mouse_x = mx;
System.out.println("Maus X"+mx+" Y"+my);
}