Game Development Reference
In-Depth Information
Performing 3D to 2D projection
When rendering our 3D world to the display, we have to somehow convert our 3D
model vertex data into 2D screen coordinates before we can draw anything. This
process is called projection and is normally carried out using matrix mathematics to
convert vertices between coordinate systems until we end up with screen coordinates
that allow the triangles that make up a 3D model to be rendered on screen.
3D model
View point
Projection of model
on to 2D screen plane
The following sections provide an overview of the steps involved in projecting a
point on to the screen to make sure you are familiar with the key concepts involved.
A thorough explanation of the mathematics of 3D graphics is beyond the scope of
this topic, so it is expected that you will be familiar with what a matrix is, and with
geometric operations such as rotations, scaling, and translations.
Understanding matrices for 3D graphics
Think back to school math lessons and you will hopefully remember matrices being
described as a useful tool when trying to perform operations such as rotations,
translations, and scaling on vectors.
My personal recollection about learning matrices was that they seemed slightly
magical at the time. Here was a grid of numbers that could be used to perform a
range of really useful geometric operations and, what's more, you could combine
several matrices by multiplying them together to perform several operations in one
go. The concept itself made sense, but there were so many numbers involved that it
seemed a bit bewildering.
In 3D geometry we generally use a 4 x 4 matrix, with the top left 3 x 3 grid of
numbers representing the rotation and scaling part of the matrix, and the first three
numbers of the bottom row representing the required translation.
 
Search WWH ::




Custom Search