Shader Learn

06 Space, camera and depth

Matrices: object → world → screen

Local coordinates → world → camera → projection.

-3.143.14
2580

Runs once per vertexDrag numbers, or edit the code

JS sidegl.uniformMatrix4fv(uModel, …) // rotation 0.50 / 0.10

gl_Position = projection × view × model × position; read it right to left.

Try it

  • Set the field of view to 80°: stronger perspective
  • Switch to the vertex stage and find the three matrices