{
  "id": 6963016,
  "title": "You don't need look-at matrices for an FPS camera",
  "url": "https://urgent.news/2026/09/12/you-dont-need-look-at-matrices-for-an-fps-camera",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-12T17:57:45.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/cutiepatootieeeee/you-dont-need-look-at-matrices-for-an-fps-camera-2j7f"
  },
  "original_language": "en",
  "account": "Writing an FPS camera often involves using look_at matrices, but this approach can be redundant. Instead of constructing a target and passing it to look_at, the camera's position and orientation can be used directly. A more straightforward method involves defining the basis vectors using the camera's position and orientation.\n\nTo create the forward direction, use the camera's pitch and yaw angles. Calculate the x, y, and z components of the forward vector using cosine and sine functions, then normalize it.\n\nNext, determine the camera's basis by finding the right and up vectors. The right vector is obtained by taking the cross product of the forward vector and the world up vector, then normalizing it. The up vector is the cross product of the right and forward vectors, also normalized.\n\nWith these directions, you can move and orient the camera. Move it along the forward and right vectors based on player input. To create a view matrix, use these axes, or alternatively, construct a camera transform and invert it. This simplified method eliminates the need for look_at matrices in FPS camera implementations.",
  "summary": "If you have ever written an FPS camera, you have probably seen something like this: vec3 forward = get_forward_vector ( yaw , pitch ); vec3 target = position + forward ; mat4 view = look_at ( position , target , world_up ); It works, but it's really redundant and there's a way simpler way of doing an FPS camera properly. Constructing a target just to pass it to look_at is unnecessary. The camera…",
  "key_points": [
    "Use camera's position and orientation directly, not lookat matrices",
    "Define forward direction using pitch and yaw angles",
    "Calculate right and up vectors for camera basis"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}