//-----------------------------------------------------------------------------// Name: SetWorld()// Desc: Sets and returns the world matrix//-----------------------------------------------------------------------------D3DXMATRIX CWorld::SetWorld( LPDIRECT3DDEVICE8 pDevice ){ D3DXMATRIX matWorld; // Create the world matrix pDevice->SetTransform( D3DTS_WORLD, &matWorld ); // Set world matrix to &matWorld return matWorld; // Return the world matrix}//-----------------------------------------------------------------------------// Name: SetView()// Desc: Sets and returns the view matrix//-----------------------------------------------------------------------------D3DXMATRIX CWorld::SetView( LPDIRECT3DDEVICE8 pDevice, const D3DXVECTOR3* pEye, const D3DXVECTOR3* pAt, const D3DXVECTOR3* pUp ){ D3DXMATRIX matView; // Create the view matrix // Look at the *pAt parameter passed in D3DXMatrixLookAtLH( &matView, pEye, pAt, pUp ); pDevice->SetTransform( D3DTS_VIEW, &matView ); // Set the view matrix to &matView return matView; // Return the view matrix}//-----------------------------------------------------------------------------// Name: SetProjection()// Desc: Sets and returns the projection matrix//-----------------------------------------------------------------------------D3DXMATRIX CWorld::SetProjection( LPDIRECT3DDEVICE8 pDevice ){ // Create the projection matrix D3DXMATRIX matProj; // Set the perspective D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f ); // Set the view matrix to &matProj pDevice->SetTransform( D3DTS_PROJECTION, &matProj ); // return the projection matrix return matProj;}
Any ideas?
Edited by - Sheep on February 27, 2002 1:41:34 PM
Edited by - Sheep on February 27, 2002 8:24:07 PM