Continuing from my previous post, The camera is an essential element of my terrain rendering. It is important to ensure that it is dynamically defined each frame, to give the user the ability to freely rotate and move around the screen. Research into this topic has shown me that there are 3 essential matrices needed to perform this :
- World Matrix
- View Matrix
- Projection Matrix
The World Matrix transforms 3D elements of the model into “world space”. This needs to be calculated prior to the rendering of each element of our 3D world,
The View Matrix transforms from “world space” into “view space”. This is how the user can see the 3D world on what is essentially a 2-Dimensional screen. This needs to be calculated every time the camera moves.
The Projection Matrix transforms the “view space” into “screen space”. This is calculated at the start of the program. This is like saying, draw everything within the cameras viewport. It can be viewed here
It is important to note that the coordinate system being used is known as left-handed cartesian coordinates
I will write 3 new posts after this going into further detail about each matrix we use