WebGL Matrix Naming Conventions

Before we go any further, let's take a moment to quickly summarize some of the conventions around matrix-naming. As we've seen, WebGL is a simple API with nearly everything except for a few predefined names, such as gl_Position defined by you, the programmer. That being said, common and semi-common naming conventions do exist. This is especially true for matrices. Here are a few important ones we’ve already covered, along with a few new ones that we’ll cover shortly:

  • World Matrix: Sometimes referred to as the Model matrix, this is a matrix that takes the vertices of a model and moves them to world space.
  • Camera Matrix: This matrix positions the camera in the world. You can also think of it as the World matrix for the camera.
  • View Matrix: This matrix moves everything else in the world in front of the camera. As we've seen, this is the inverse of the Camera matrix.
  • Projection Matrix: This is the matrix that converts a frustum of space into clip space. You can also think of it as the matrix returned by your matrix math library's perspective or orthographic function.
  • Local Matrix: The matrix is used in scene graphs, where the matrix, at any particular node on the graph, is used before multiplying with any other nodes.
Scene Graph

This is a data structure, commonly used by vector-based graphics-editing applications and modern computer games, that arranges the logical and often spatial representation of a graphical scene. A scene graph is a collection of nodes in a graph or tree structure. For more information, please visit https://en.wikipedia.org/wiki/Scene_graph.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.13.201