Location:
Search - D3DXMATRIX
Search list
Description:
//建立并设置世界矩阵
D3DXMATRIX matWorld
D3DXMatrixIdentity( &matWorld )
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld )
//建立并设置观察矩阵
D3DXVECTOR3 vEyePt( 0.0f, 3.0f,-5.0f )
D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f )
D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f )
D3DXMATRIX matView
D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec )
g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView )
//建立并设置投影矩阵
D3DXMATRIX matProj
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f )
g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj ) -//Create and set the world matrix D3DXMATRIX matWorld D3DXMatrixIdentity (
Platform: |
Size: 498688 |
Author: yourname |
Hits: