Mtxroll the resulting matrix returned the mtxrotate variable
|
---|
The next step is to use the D3DXMatrixMultiply (which multiplies two matrices) function to combine all of these rotations into a final matrix. This function is an alternative to using the overloaded * operator. We use D3DXMatrixMultiply to better see the multiplication order.
Object1 now has its world matrix updated to contain the new rotations. When this matrix is used to transform the mesh vertices later, the object will be rendered in its new orientation.
We repeat the same steps for Object2 and the function returns.
{ | |
|
---|
|
---|
|
|
---|---|
{ |
|
} |
---|
As you can see we have used D3DXMatrixRotationYawPitchRoll to build a matrix that contains all three rotations in one call. The resulting matrix is multiplied with the object world matrices using the overloaded * operator instead of the D3DXMatrixMultiply function.
CGameApp::DrawPrimitive
The object that this polygon belongs to has had its world matrix passed in so we can multiply each vertex with this matrix to transform it into world space:
|
---|