本文整理汇总了C++中CFirstPersonCamera::SetProjParams方法的典型用法代码示例。如果您正苦于以下问题:C++ CFirstPersonCamera::SetProjParams方法的具体用法?C++ CFirstPersonCamera::SetProjParams怎么用?C++ CFirstPersonCamera::SetProjParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFirstPersonCamera
的用法示例。
在下文中一共展示了CFirstPersonCamera::SetProjParams方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateViewerCameraNearFar
//--------------------------------------------------------------------------------------
// Calcaulte the camera based on size of the current scene
//--------------------------------------------------------------------------------------
void UpdateViewerCameraNearFar()
{
XMVECTOR vMeshExtents = g_CascadedShadow.GetSceneAABBMax() - g_CascadedShadow.GetSceneAABBMin();
XMVECTOR vMeshLength = XMVector3Length(vMeshExtents);
FLOAT fMeshLength = XMVectorGetByIndex(vMeshLength, 0);
g_ViewerCamera.SetProjParams(XM_PI / 4, g_fAspectRatio, 0.05f, fMeshLength);
}
示例2: XMVectorGetByIndex
//--------------------------------------------------------------------------------------
// Create any D3D11 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
UNREFERENCED_PARAMETER(pSwapChain);
UNREFERENCED_PARAMETER(pUserContext);
HRESULT hr;
XMVECTOR vMeshExtents = g_Scene.GetSceneAABBMax() - g_Scene.GetSceneAABBMin();
XMVECTOR vMeshLength = XMVector3Length( vMeshExtents );
FLOAT fMeshLength = XMVectorGetByIndex( vMeshLength, 0);
V_RETURN( g_DialogResourceManager.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
V_RETURN( g_D3DSettingsDlg.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
g_fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT ) pBackBufferSurfaceDesc->Height;
g_ViewerCamera.SetProjParams( XM_PI / 4, g_fAspectRatio, 0.05f, fMeshLength);
g_Scene.OnResize(pBackBufferSurfaceDesc->Width, pBackBufferSurfaceDesc->Height);
g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 300 );
g_SampleUI.SetSize( 170, 300 );
return S_OK;
}
示例3:
//--------------------------------------------------------------------------------------
// Create any D3D11 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr;
V_RETURN( g_DialogResourceManager.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
V_RETURN( g_D3DSettingsDlg.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
// Setup the camera's projection parameters
float fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT )pBackBufferSurfaceDesc->Height;
g_Camera.SetProjParams( D3DX_PI / 4, fAspectRatio, 2.0f, 4000.0f );
// g_Camera.SetWindow( pBackBufferSurfaceDesc->Width, pBackBufferSurfaceDesc->Height );
// g_Camera.SetButtonMasks( MOUSE_MIDDLE_BUTTON, MOUSE_WHEEL, MOUSE_LEFT_BUTTON );
D3DXVECTOR3 vMin = D3DXVECTOR3( -1000.0f, -1000.0f, -1000.0f );
D3DXVECTOR3 vMax = D3DXVECTOR3( 1000.0f, 1000.0f, 1000.0f );
g_Camera.SetRotateButtons(TRUE, FALSE, FALSE);
g_Camera.SetScalers( 0.01f, 30.0f );
g_Camera.SetDrag( true );
g_Camera.SetEnableYAxisMovement( true );
g_Camera.SetClipToBoundary( TRUE, &vMin, &vMax );
g_Camera.FrameMove( 0 );
g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 300 );
g_SampleUI.SetSize( 170, 300 );
//Turn off backface culling
D3D11_RASTERIZER_DESC rsDesc;
ZeroMemory(&rsDesc,sizeof(D3D11_RASTERIZER_DESC) );
rsDesc.CullMode = D3D11_CULL_NONE;
rsDesc.FillMode = D3D11_FILL_SOLID;
//rsDesc.FillMode = D3D11_FILL_WIREFRAME;
ID3D11RasterizerState *pRasterizerState = NULL;
pd3dDevice->CreateRasterizerState(&rsDesc, &pRasterizerState);
DXUTGetD3D11DeviceContext()->RSSetState(pRasterizerState);
SAFE_RELEASE(pRasterizerState);
return S_OK;
}
示例4:
//--------------------------------------------------------------------------------------
// Callback function for changed window size
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr;
V_RETURN( g_DialogResourceManager.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
V_RETURN( g_D3DSettingsDlg.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
// Setup the camera's projection parameters
float fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT )pBackBufferSurfaceDesc->Height;
g_Camera.SetProjParams( D3DX_PI / 4, fAspectRatio, 0.5f, 100.0f );
g_LCamera.SetProjParams( D3DX_PI / 4, fAspectRatio, 10.0f, 100.0f );
g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 240 );
g_SampleUI.SetSize( 150, 110 );
return S_OK;
}
示例5: CreateD3DComponents
//--------------------------------------------------------------------------------------
// When the user changes scene, recreate these components as they are scene
// dependent.
//--------------------------------------------------------------------------------------
HRESULT CreateD3DComponents( ID3D11Device* pd3dDevice)
{
HRESULT hr;
auto pd3dImmediateContext = DXUTGetD3D11DeviceContext();
V_RETURN( g_DialogResourceManager.OnD3D11CreateDevice( pd3dDevice, pd3dImmediateContext ) );
V_RETURN( g_D3DSettingsDlg.OnD3D11CreateDevice( pd3dDevice ) );
g_pTxtHelper = new CDXUTTextHelper( pd3dDevice, pd3dImmediateContext, &g_DialogResourceManager, 15 );
static const XMVECTORF32 s_vecEye = { 105.0f, 14.0f, -3.0f, 0.f };
static const XMVECTORF32 s_vecLookAt = { 0.0f, -7.5f, 0.0f, 0.f };
XMFLOAT3 vMin = XMFLOAT3( -1000.0f, -1000.0f, -1000.0f );
XMFLOAT3 vMax = XMFLOAT3( 1000.0f, 1000.0f, 1000.0f );
g_ViewerCamera.SetViewParams( s_vecEye, s_vecLookAt );
g_ViewerCamera.SetRotateButtons( true, false, false);
g_ViewerCamera.SetScalers( 0.01f, 10.0f );
g_ViewerCamera.SetDrag( true );
g_ViewerCamera.SetEnableYAxisMovement( true );
g_ViewerCamera.SetClipToBoundary( true, &vMin, &vMax );
g_ViewerCamera.FrameMove( 0 );
static const XMVECTORF32 s_lightEye = { -320.0f, 300.0f, -220.3f, 0.f };
g_LightCamera.SetViewParams( s_lightEye, g_XMZero );
g_LightCamera.SetRotateButtons( true, false, false );
g_LightCamera.SetScalers( 0.01f, 50.0f );
g_LightCamera.SetDrag( true );
g_LightCamera.SetEnableYAxisMovement( true );
g_LightCamera.SetClipToBoundary( true, &vMin, &vMax );
g_LightCamera.SetProjParams( XM_PI / 4, 1.0f, 0.1f , 1000.0f);
g_LightCamera.FrameMove( 0 );
// Get the final sizes
uint32_t width = DXUTGetDXGIBackBufferSurfaceDesc()->Width;
uint32_t height = DXUTGetDXGIBackBufferSurfaceDesc()->Height;
g_Scene.Init( pd3dDevice, pd3dImmediateContext, &g_MeshPowerPlant, width, height);
return S_OK;
}
示例6:
//--------------------------------------------------------------------------------------
// Create any D3D11 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr;
V_RETURN( g_DialogResourceManager.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
V_RETURN( g_D3DSettingsDlg.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
// Setup the camera's projection parameters
float fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT )pBackBufferSurfaceDesc->Height;
g_Camera.SetProjParams( XM_PI / 4, fAspectRatio, 0.1f, 2000.0f );
//g_Camera.SetWindow( pBackBufferSurfaceDesc->Width, pBackBufferSurfaceDesc->Height );
//g_Camera.SetButtonMasks( MOUSE_MIDDLE_BUTTON, MOUSE_WHEEL, MOUSE_LEFT_BUTTON );
g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 300 );
g_SampleUI.SetSize( 170, 300 );
return S_OK;
}
示例7: CreateD3DComponents
//--------------------------------------------------------------------------------------
// When the user changes scene, recreate these components as they are scene
// dependent.
//--------------------------------------------------------------------------------------
HRESULT CreateD3DComponents(ID3D11Device* pd3dDevice)
{
HRESULT hr;
ID3D11DeviceContext* pd3dImmediateContext = DXUTGetD3D11DeviceContext();
V_RETURN(g_DialogResourceManager.OnD3D11CreateDevice(pd3dDevice, pd3dImmediateContext));
V_RETURN(g_D3DSettingsDlg.OnD3D11CreateDevice(pd3dDevice));
g_pTxtHelper = new CDXUTTextHelper(pd3dDevice, pd3dImmediateContext, &g_DialogResourceManager, 15);
XMVECTOR vecEye = XMVectorSet(100.0f, 5.0f, 5.0f, 0);
XMVECTOR vecAt = XMVectorSet(0.0f, 0.0f, 0.0f, 0);
XMFLOAT3 vMin = XMFLOAT3(-1000.0f, -1000.0f, -1000.0f);
XMFLOAT3 vMax = XMFLOAT3(1000.0f, 1000.0f, 1000.0f);
g_ViewerCamera.SetViewParams(vecEye, vecAt);
g_ViewerCamera.SetRotateButtons(TRUE, FALSE, FALSE);
g_ViewerCamera.SetScalers(0.01f, 10.0f);
g_ViewerCamera.SetDrag(true);
g_ViewerCamera.SetEnableYAxisMovement(true);
g_ViewerCamera.SetClipToBoundary(TRUE, &vMin, &vMax);
g_ViewerCamera.FrameMove(0);
vecEye = XMVectorSet(-320.0f, 300.0f, -220.3f, 0);
vecAt = XMVectorSet(0.0f, 0.0f, 0.0f, 0);
g_LightCamera.SetViewParams(vecEye, vecAt);
g_LightCamera.SetRotateButtons(TRUE, FALSE, FALSE);
g_LightCamera.SetScalers(0.01f, 50.0f);
g_LightCamera.SetDrag(true);
g_LightCamera.SetEnableYAxisMovement(true);
g_LightCamera.SetClipToBoundary(TRUE, &vMin, &vMax);
g_LightCamera.SetProjParams(XM_PI / 4, 1.0f, 0.1f, 1000.0f);
g_LightCamera.FrameMove(0);
g_CascadedShadow.Init(pd3dDevice, pd3dImmediateContext,
g_pSelectedMesh, &g_ViewerCamera, &g_LightCamera, &g_CascadeConfig);
return S_OK;
}
示例8: DXUTTRACE
//--------------------------------------------------------------------------------------
// SwapChain has changed and may have new attributes such as size.
// Create any D3D11 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D11ResizedSwapChain(ID3D11Device* pd3dDevice, IDXGISwapChain *pSwapChain, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext)
{
HRESULT hr;
DXUTTRACE(L"OnD3D11ResizedSwapChain called\n");
V_RETURN( g_DialogResourceManager.OnD3D11ResizedSwapChain(pd3dDevice, pBackBufferSurfaceDesc) );
V_RETURN( g_SettingsDlg.OnD3D11ResizedSwapChain(pd3dDevice, pBackBufferSurfaceDesc) );
g_BackBufferWidth = pBackBufferSurfaceDesc->Width;
g_BackBufferHeight = pBackBufferSurfaceDesc->Height;
g_FullViewport.TopLeftX = 0.f;
g_FullViewport.TopLeftY = 0.f;
g_FullViewport.MinDepth = 0.f;
g_FullViewport.MaxDepth = 1.f;
g_FullViewport.Width = (FLOAT)g_BackBufferWidth;
g_FullViewport.Height = (FLOAT)g_BackBufferHeight;
// Setup the camera's projection parameters
float AspectRatio = (float)g_BackBufferWidth / (float)g_BackBufferHeight;
g_OrbitalCamera.SetProjParams (FOVY, AspectRatio, ZNEAR, ZFAR);
g_OrbitalCamera.SetWindow (g_BackBufferWidth, g_BackBufferHeight);
g_OrbitalCamera.SetButtonMasks(MOUSE_LEFT_BUTTON, MOUSE_WHEEL, 0);
g_FirstPersonCamera.SetProjParams (FOVY, AspectRatio, ZNEAR, ZFAR);
g_FirstPersonCamera.SetRotateButtons( 1, 1, 1 );
UINT HudWidth = 256;
float HudOpacity = 0.32f;
g_HUD.SetLocation(g_BackBufferWidth - HudWidth, 0);
g_HUD.SetSize (HudWidth, g_BackBufferHeight);
g_HUD.SetBackgroundColors(D3DCOLOR_COLORVALUE(0,0,0,HudOpacity));
// Allocate our own screen-sized buffers, as the SwapChain only contains a non-MSAA color buffer.
ResizeScreenSizedBuffers(pd3dDevice);
return hr;
}
示例9: sizeof
//--------------------------------------------------------------------------------------
// Create any D3D11 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain,
const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
HRESULT hr;
V_RETURN( g_DialogResourceManager.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
V_RETURN( g_D3DSettingsDlg.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) );
// Setup the camera's projection parameters
width = pBackBufferSurfaceDesc->Width;
height = pBackBufferSurfaceDesc->Height;
float fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT )pBackBufferSurfaceDesc->Height;
g_Camera.SetProjParams( D3DX_PI / 4, fAspectRatio, 2.0f, 100000.0f );
//g_Camera.SetWindow( pBackBufferSurfaceDesc->Width, pBackBufferSurfaceDesc->Height );
//g_Camera.SetButtonMasks( MOUSE_MIDDLE_BUTTON, MOUSE_WHEEL, MOUSE_LEFT_BUTTON );
g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 300 );
g_SampleUI.SetSize( 170, 300 );
//deboard.OnD3D11ResizedSwapChain(pd3dDevice,pSwapChain,pBackBufferSurfaceDesc,pUserContext);
DXGI_FORMAT format;
D3D11_TEXTURE2D_DESC info ;
ZeroMemory (& info , sizeof ( info ));
info.Width = pBackBufferSurfaceDesc->Width;
info.Height = pBackBufferSurfaceDesc->Height;
info.MipLevels = 1;
info.ArraySize = 1;
info.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
info.SampleDesc . Count = 1;
info.Usage = D3D11_USAGE_DEFAULT;
info.BindFlags = D3D11_BIND_RENDER_TARGET|D3D11_BIND_SHADER_RESOURCE ;
info.CPUAccessFlags = 0;
info.MiscFlags = 0;
hr = pd3dDevice->CreateTexture2D(&info,nullptr,&original_texture);
hr = pd3dDevice->CreateTexture2D(&info,nullptr,&texture1);
hr = pd3dDevice->CreateTexture2D(&info,nullptr,&texture2);
format = info.Format;
D3D11_SAMPLER_DESC sampDesc;
ZeroMemory( &sampDesc, sizeof(sampDesc) );
sampDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
sampDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP ;
sampDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP ;
sampDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP ;
sampDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;
sampDesc.MinLOD = 0;
sampDesc.MaxLOD = 0;
hr = pd3dDevice->CreateSamplerState( &sampDesc, &g_pSamLinear );
// render target view
D3D11_RENDER_TARGET_VIEW_DESC target_info;
target_info.Format = format;
target_info.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
target_info.Texture2D.MipSlice = 0;
hr = pd3dDevice->CreateRenderTargetView(original_texture, &target_info ,&rtv_render_to_texture_ori);
hr = pd3dDevice->CreateRenderTargetView(texture1, &target_info ,&rtv_render_to_texture_1);
hr = pd3dDevice->CreateRenderTargetView(texture2, &target_info ,&rtv_render_to_texture_2);
D3D11_SHADER_RESOURCE_VIEW_DESC shader_resource_info;
shader_resource_info.Format = format;
shader_resource_info.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
shader_resource_info.Texture2D . MostDetailedMip = 0;
shader_resource_info.Texture2D . MipLevels = 1;
hr = pd3dDevice->CreateShaderResourceView(original_texture, &shader_resource_info ,&sr_texture_original);
hr = pd3dDevice->CreateShaderResourceView(texture1, &shader_resource_info ,&sr_texture1);
hr = pd3dDevice->CreateShaderResourceView(texture2, &shader_resource_info ,&sr_texture2);
return S_OK;
}
示例10: vecLightDirUnnormalized
//--------------------------------------------------------------------------------------
// Create any D3D9 resources that won't live through a device reset (D3DPOOL_DEFAULT)
// or that are tied to the back buffer size
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D9ResetDevice( IDirect3DDevice9* pd3dDevice,
const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext )
{
#ifdef CONSOLE
std::cout << "OnD3D9ResetDevice" << std::endl;
#endif
HRESULT hr;
V_RETURN( g_DialogResourceManager.OnD3D9ResetDevice() );
V_RETURN( g_SettingsDlg.OnD3D9ResetDevice() );
if( g_pFont9 ) V_RETURN( g_pFont9->OnResetDevice() );
if( g_pEffect9 ) V_RETURN( g_pEffect9->OnResetDevice() );
V_RETURN( D3DXCreateSprite( pd3dDevice, &g_pSprite9 ) );
g_pTxtHelper = new CDXUTTextHelper( g_pFont9, g_pSprite9, NULL, NULL, 15 );
g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 );
g_HUD.SetSize( 170, 170 );
g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 350 );
g_SampleUI.SetSize( 170, 300 );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
//pd3dDevice->SetRenderState( D3DRS_DITHERENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_SPECULARENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_LIGHTING, false );
pd3dDevice->SetRenderState( D3DRS_AMBIENT, 0x80808080 );
D3DLIGHT9 light;
D3DXVECTOR3 vecLightDirUnnormalized( 10.0f, -10.0f, 10.0f );
ZeroMemory( &light, sizeof( D3DLIGHT9 ) );
light.Type = D3DLIGHT_DIRECTIONAL;
light.Diffuse.r = 1.0f;
light.Diffuse.g = 1.0f;
light.Diffuse.b = 1.0f;
D3DXVec3Normalize( ( D3DXVECTOR3* )&light.Direction, &vecLightDirUnnormalized );
light.Position.x = 10.0f;
light.Position.y = -10.0f;
light.Position.z = 10.0f;
light.Range = 1000.0f;
pd3dDevice->SetLight( 0, &light );
pd3dDevice->LightEnable( 0, TRUE );
// Set the transform matrices
D3DXMATRIXA16 matWorld;
D3DXMatrixIdentity( &matWorld );
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
// Setup the camera with view & projection matrix
D3DXVECTOR3 vecEye( 0.0f, 0.0f, -5.0f );
D3DXVECTOR3 vecAt ( 0.0f, 0.0f, 0.0f );
g_Camera.SetViewParams( &vecEye, &vecAt );
float fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT )pBackBufferSurfaceDesc->Height;
g_Camera.SetProjParams( D3DX_PI / 4, fAspectRatio, 1.0f, 1000.0f );
return S_OK;
}