Guest User

Untitled

a guest
Oct 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. // SET UP THE PIPELINE
  2.  
  3.         D3DXMATRIX matRotateY;    // a matrix to store the rotation information
  4.  
  5.         static float index = 0.0f; index+=0.5f;    // an ever-increasing float value
  6.  
  7.         // build a matrix to rotate the model based on the increasing float value
  8.         D3DXMatrixRotationY(&matRotateY, 0);
  9.  
  10.         // tell Direct3D about our matrix
  11.         D3DDevice->SetTransform(D3DTS_WORLD, &matRotateY);
  12.  
  13.         D3DXMATRIX matView;    // the view transform matrix
  14.  
  15.         D3DXMatrixLookAtLH(&matView,
  16.                           &D3DXVECTOR3 (0.0f, 0.0f, 0.0f),    // the camera position
  17.                            &D3DXVECTOR3 (0.0f, 0.0f, 0.0),    // the look-at position
  18.                            &D3DXVECTOR3 (0.0f, 1.0f, 0.0f));    // the up direction
  19.  
  20.         D3DDevice->SetTransform(D3DTS_VIEW, &matView);    // set the view transform to matView
  21.  
  22.         D3DXMATRIX matProjection;     // the projection transform matrix
  23.  
  24.         D3DXMatrixOrthoLH(&matProjection,    // the horizontal field of view
  25.                                    (FLOAT)SCREEN_WIDTH, (FLOAT)SCREEN_HEIGHT, // aspect ratio
  26.                                    1.0f,    // the near view-plane
  27.                                    100.0f);    // the far view-plane
  28.  
  29.         D3DDevice->SetTransform(D3DTS_PROJECTION, &matProjection);    // set the projection
Add Comment
Please, Sign In to add comment