View matrix

The LookAt function is mainly used for 3D graphics. It is a convenient way to position a 3D camera. While graphics programming is outside the scope of this book, for our math library to be practical we need to implement some graphics-related functionality.

Getting a vertex (vector) to become a pixel primarily involves three matrix transformations. The world transform, view transform, and projection transform. All three of these transformations are expressed as a matrix multiplication.

  • The world transform takes the vertex from model space to world space, we've already implemented this as the Transform function
  • The view transform takes a vertex from world space and transforms it to eye space, sometimes called view space or camera space ...

Get Game Physics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.