title: How to move in the direction of the camera, OpenGL, c++
body: <p>I'm starting a 3D scene and I'm working on the movement of the "camera", or the entity moving around but I can't seem to get it to move in the direction it is facing.</p>
  
  <p><img src="https://i.stack.imgur.com/FdC9n.gif" alt="Example"></p>
  
  <p>Does anyone have any guidance about how I'd begin to move in the direction of the camera? However I only want the entity to be moving along the x and z axis, as if it were on the floor and the y axis would be disregarded for now. If anyone could tell me what math is involved, it'd be really appreciated.</p>
  
  <pre><code>Camera::Camera(Vector3 * eye, Vector3 * center, Vector3 * up) {
      this-&gt;eye = eye;
      this-&gt;center = center;
      this-&gt;up = up;
  }
  
  Camera::Vector3 * getEye() { return eye; }
  Camera::Vector3 * getCenter() { return center; }
  Camera::Vector3 * getUp() { return up; }
  
  
  
  camera = new Camera(new Vector3(5.0f, 3.0f, 5.0f), 
      new Vector3(0.0f, 0.0f, 0.0f), 
      new Vector3(0.0f, 1.0f, 0.0f));
  
  
  gluLookAt(camera-&gt;eye-&gt;getX(), camera-&gt;eye-&gt;getY(), camera-&gt;eye-&gt;getZ(),
              camera-&gt;center-&gt;getX(), camera-&gt;center-&gt;getY(), camera-&gt;center-&gt;getZ(),
              camera-&gt;up-&gt;getX(), camera-&gt;up-&gt;getY(), camera-&gt;up-&gt;getZ());//camera
  </code></pre>