// A simple way to "bob" the camera as the user moves cam.translate(0.0f, (float)Math.sin(headDeg) / 40.0f, 0.0f); } else if(key[DOWN]) { // Move backward cam.translate(0.1f * (float)camSine, 0.0f, 0.1f * (float)camCosine);
// Bob head headDeg -= 0.5f;
// A simple way to "bob" the camera as the user moves cam.translate(0.0f, (float)Math.sin(headDeg) / 40.0f, 0.0f);