title: How to make mouse navigation?
body: <p>I am using LibGDX for my game and I want the mouse to move the "head" of the player, eg. like in Minecraft. How would I achieve this? I have got it to kinda work with yaw and pitch values that glRotateF what is being rendered, but the mouse moves outside the window (obviously) after a while of turning right. I have tried to use the robot class to reset the pointer position to the center of the screen but then navigation is nearly impossible. </p>
  
  <p>Here is my player class:</p>
  
  <pre><code>package com.amzoft.gdxracingtestgamething;
  
  import com.badlogic.gdx.Gdx;
  import com.badlogic.gdx.InputProcessor;
  import com.badlogic.gdx.graphics.GL11;
  
  public class Player implements InputProcessor{
  
      int pitch = 0;
      int yaw = 0;
  
      public Player()
      {
  
      }
  
      public void render()
      {
          GL11 gl = Gdx.gl11;
          gl.glRotatef(-yaw, 0, 1, 0);
          gl.glRotatef(-pitch, 1, 0, 0);
      }
  
      /*....a ton of unused implemented methods*/
  
      int xBefore = 0;
      int yBefore = 0;
  
      @Override
      public boolean touchMoved(int x, int y) 
      {
          if(xBefore&lt;x-3)
          {
              yaw += 1;
          }
          if(xBefore&gt;x+3)
          {
              yaw -= 1;
          }
          if(yBefore&lt;y-3)
          {
              pitch -= 1;
          }
          if(yBefore&gt;y+3)
          {
              pitch += 1;
          }
          if(yaw &gt; 90)yaw = 90;
          if(yaw &lt; -90)yaw = -90;
          if(pitch &gt; 90)pitch = 90;
          if(pitch &lt; -90)pitch = -90;
          xBefore = x;
          yBefore = y;
          return true;
      }
  
      @Override
      public boolean scrolled(int amount) 
      {
          return false;
      }
  
  }
  </code></pre>
  
  <p>Im sorry if the solution is very obvious, I am very new to 3D game development and LibGDX.</p>