void Camera(GameWindow *pGw)
{
//Sets the Wolrd
D3DXMATRIX rotY;
static float index = 0 ; index += 0.05f ;
D3DXMatrixRotationY(&rotY,index);
d3ddev->SetTransform(D3DTS_WORLD,&rotY);
//Sets the View
D3DXMATRIX view;
D3DXVECTOR3 position(0.0f,5.0f,20.0f);
D3DXVECTOR3 look(0.0f,1.0f,0.0f);
D3DXVECTOR3 up(0.0f,1.0f,0.0f);
D3DXMatrixLookAtLH(&view,&position,&look,&up);
d3ddev->SetTransform(D3DTS_VIEW,&view);
//Sets the lens
D3DXMATRIX projection;
D3DXMatrixPerspectiveFovLH(&projection,D3DXToRadian(45),
(float)(pGw->getWidth()/pGw->getHeight()),1.0f,100.0f);
d3ddev->SetTransform(D3DTS_PROJECTION,&projection);
}
Partager