6
Understanding
Vector and Matrix
Welcome to Chapter 6! In the previous chapter, we added a simple UI with elements to show the status of the program and timings for some of the functions, plus some simple controls to change the behavior of the program.
In this chapter, we will explore both the mathematical elements and the computer data types vector and matrix. We start with a review of the basic properties of each type and the operations between the same data types, as well as operations between vectors and matrices. The focus here is on the execution of these operations using the OpenGL Mathematics (GLM) library, as the library does all the operations we need with simple function calls.
At the end of the chapter, a practical exercise on matrix and vector operations follows: we will add a freely rotating and freely moving camera to the virtual world, both in the OpenGL and Vulkan renderer, allowing us to view objects from every angle.
In this chapter, we will cover the...