Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SET UP THE PIPELINE
- D3DXMATRIX matRotateY; // a matrix to store the rotation information
- static float index = 0.0f; index+=0.5f; // an ever-increasing float value
- // build a matrix to rotate the model based on the increasing float value
- D3DXMatrixRotationY(&matRotateY, 0);
- // tell Direct3D about our matrix
- D3DDevice->SetTransform(D3DTS_WORLD, &matRotateY);
- D3DXMATRIX matView; // the view transform matrix
- D3DXMatrixLookAtLH(&matView,
- &D3DXVECTOR3 (0.0f, 0.0f, 0.0f), // the camera position
- &D3DXVECTOR3 (0.0f, 0.0f, 0.0), // the look-at position
- &D3DXVECTOR3 (0.0f, 1.0f, 0.0f)); // the up direction
- D3DDevice->SetTransform(D3DTS_VIEW, &matView); // set the view transform to matView
- D3DXMATRIX matProjection; // the projection transform matrix
- D3DXMatrixOrthoLH(&matProjection, // the horizontal field of view
- (FLOAT)SCREEN_WIDTH, (FLOAT)SCREEN_HEIGHT, // aspect ratio
- 1.0f, // the near view-plane
- 100.0f); // the far view-plane
- D3DDevice->SetTransform(D3DTS_PROJECTION, &matProjection); // set the projection
Add Comment
Please, Sign In to add comment