Drohne/SDK/ARDrone_SDK_2_0_1/ARDrone_SDK_2_0_1/Examples/Win32/sdk_demo/Sources/UI/directx_rendering.cpp
//-----------------------------------------------------------------------------
// Name: SetupMatrices()
// Desc: Sets up the world, view, and projection transform matrices.
//-----------------------------------------------------------------------------
SetupMatrices()
Desc: Sets up the world, view, and projection transform matrices.
SetupMatrices () Desc : Sets up the world view and projection transform matrices .
VOID SetupMatrices()
{
    D3DXMATRIXA16 matWorld;
    D3DXMatrixIdentity( &matWorld );
    D3DXMatrixRotationX( &matWorld, 0.0f );
    g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
    D3DXVECTOR3 vEyePt( 0.0f, 0.0f,-2.0f );
    D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f );
    D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f );
    D3DXMATRIXA16 matView;
    D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
    g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
    D3DXMATRIXA16 matProj;
    D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI / 4, 1.0f, 1.0f, 100.0f );
    g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
}
VOID SetupMatrices ( ) { D3DXMATRIXA16 matWorld ; D3DXMatrixIdentity ( & matWorld ) ; D3DXMatrixRotationX ( & matWorld , 0.0f ) ; g_pd3dDevice -> SetTransform ( D3DTS_WORLD , & matWorld ) ; D3DXVECTOR3 vEyePt ( 0.0f , 0.0f , -2.0f ) ; D3DXVECTOR3 vLookatPt ( 0.0f , 0.0f , 0.0f ) ; D3DXVECTOR3 vUpVec ( 0.0f , 1.0f , 0.0f ) ; D3DXMATRIXA16 matView ; D3DXMatrixLookAtLH ( & matView , & vEyePt , & vLookatPt , & vUpVec ) ; g_pd3dDevice -> SetTransform ( D3DTS_VIEW , & matView ) ; D3DXMATRIXA16 matProj ; D3DXMatrixPerspectiveFovLH ( & matProj , D3DX_PI / 4 , 1.0f , 1.0f , 100.0f ) ; g_pd3dDevice -> SetTransform ( D3DTS_PROJECTION , & matProj ) ; }
Name: SetupMatrices()
Desc: Sets up the world, view, and projection transform matrices.
Name : SetupMatrices () Desc : Sets up the world view and projection transform matrices .
// Set up world matrix // Set up our view matrix. A view matrix can be defined given an eye point, // a point to lookat, and a direction for which way is up. Here, we set the // eye five units back along the z-axis and up three units, look at the // origin, and define "up" to be in the y-direction. // For the projection matrix, we set up a perspective transform (which // transforms geometry from 3D view space to 2D viewport space, with // a perspective divide making objects smaller in the distance). To build // a perpsective transform, we need the field of view (1/4 pi is common), // the aspect ratio, and the near and far clipping planes (which define at // what distances geometry should be no longer be rendered).