- C++ Game Development By Example
- Siddharth Shekar
- 322字
- 2021-06-24 14:26:16
Matrices
In computer graphics, matrices are used to calculate object transforms like translation which is movement, scaling in X,Y and Z axis, and rotation around the X,Y and Z axis. We will also be changing the position of objects from one coordinate system to the other, which are called space transforms. We will see how matrices work and how they help in simplifying the mathematics.
Matrices are represented as having rows and columns. A matrix with m number of rows and n number of columns is said to be a matrix of size m × n. Each element of a matrix is represented as indices ij where i specifies the row number and j represents the column number.
So, a matrix M of size 3 × 2 is represented as as follows:

Here, matrix M has three rows and two columns and each element is represented as m11, m12 and so on until m32, which is the size of the matrix.
In 3D graphics programming, we will be mostly dealing with a 4×4 matrix. So, let us look at another matrix of size 4x4.

Matrix A with numbers in it is:

Here, the element A11 = 3, A32 = 1 and A44 = 1 and the dimension of the matrix is 4×4.
We can also have a single-dimension matrix like vector B as follows which is called the row vector or a column vector as shown as follows ad vector C:

- Two matrices are equal if the number of rows and columns are the same and if the corresponding elements are of the same value.
- Two matrices can be added if they have the same number of rows and columns. We add each element of the corresponding location on both matrices to get a third matrix of the same dimension as the added matrices.
- Learning SQL Server Reporting Services 2012
- 電腦組裝與維修從入門到精通(第2版)
- 施耐德SoMachine控制器應用及編程指南
- 硬件產品經理手冊:手把手構建智能硬件產品
- 從零開始學51單片機C語言
- Mastering Adobe Photoshop Elements
- CC2530單片機技術與應用
- SiFive 經典RISC-V FE310微控制器原理與實踐
- 計算機組裝維修與外設配置(高等職業院校教改示范教材·計算機系列)
- 深入理解序列化與反序列化
- 超大流量分布式系統架構解決方案:人人都是架構師2.0
- Istio服務網格技術解析與實踐
- RISC-V處理器與片上系統設計:基于FPGA與云平臺的實驗教程
- 圖解計算機組裝與維護
- 電腦組裝與維護即時通