Co-ordinate systems
We're using Direct3D to display our 2D world, which means we need to consider the differences between how we work with 3D and what we need for 2D, and adapt to make everything fit together. For our purposes DirectXTK will take care of most of this; however it's useful to know what's going on, and understand the concepts involved so that you can delve into advanced concepts in future to create some amazing visuals.
In 2D the world is represented as a Cartesian plane, with the X-axis representing the horizontal axis, and the Y-axis representing the vertical. Many 2D systems, including Direct3D and DirectXTK, position the co-ordinate (0, 0)
, also known as the
origin, at the top-left corner of the screen.
3D adds a third dimension, Z, to the mix, which represents the axis perpendicular to both X and Y, heading "away" from the viewer if you view the X/Y plane head on. When referring to the camera, this represents the depth of the image, and...