这篇教程C++ D3DXMatrixPerspectiveFovLH函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中D3DXMatrixPerspectiveFovLH函数的典型用法代码示例。如果您正苦于以下问题:C++ D3DXMatrixPerspectiveFovLH函数的具体用法?C++ D3DXMatrixPerspectiveFovLH怎么用?C++ D3DXMatrixPerspectiveFovLH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了D3DXMatrixPerspectiveFovLH函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: D3DXVECTOR3Camera::Camera(HWND g_hWnd, GraphicsEngineParams params){ this->forceBoundries = false; this->g_hWnd = g_hWnd; this->params = params; this->pos = D3DXVECTOR3(0, 0, 0); this->terrain = NULL; this->followTarget = NULL; this->moveOnlyInXZ = false; this->angleX = 0; this->angleY = 0; this->speed = 1.0f; this->sensitivity = 1.0f; this->updateCamera = true; this->activeWindowDisabling = true; D3DXMatrixPerspectiveFovLH(&this->projection, (float)D3DX_PI * this->params.FOV, this->params.windowWidth / (float)this->params.windowHeight, this->params.NearClip, this->params.FarClip);}
开发者ID:Edaenge,项目名称:NDYGFX,代码行数:20,
示例2: D3DXMatrixIdentityvoid DXCamera::Init(){ // world D3DXMatrixIdentity( &_world ); // view _eyeVec = D3DXVECTOR3( 0.0f, 50, -70 ); // camera position _lookVec = D3DXVECTOR3( 0.0f, 30.0f, 0.0f ); // look at point _upVec = D3DXVECTOR3( 0.0f, 1.0f, 0.0f ); D3DXMatrixLookAtLH( &_view, &_eyeVec, &_lookVec, &_upVec ); // projection D3DXMatrixPerspectiveFovLH( &_proj, FOV, 1.0f, NEAR_PLANE, FAR_PLANE ); // transform camera D3D9_DEVICE->SetTransform( D3DTS_WORLD, &_world ); D3D9_DEVICE->SetTransform( D3DTS_VIEW, &_view ); D3D9_DEVICE->SetTransform( D3DTS_PROJECTION, &_proj );}
开发者ID:popoory67,项目名称:NinetailEngine,代码行数:20,
示例3: SetupMatrixVOID SetupMatrix(){ // Translate so the center of the box is the coordinate system origin. D3DXMATRIXA16 matWorld ; D3DXMatrixTranslation( &matWorld, -0.5f, -0.5f, 0.5f) ; g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld ); // Set up view matrix D3DXVECTOR3 vEyePt( 0.0f, 3.0f, -5.0f ); D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f ); D3DXVECTOR3 vUpVec( 0.0f, 3.0f, 0.0f ); D3DXMATRIXA16 matView; D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec ); g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView ); // Set up perspective matrix D3DXMATRIXA16 matProj; D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 1000.0f ); g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );}
开发者ID:Clearlove1992,项目名称:GraphicsDemos,代码行数:20,
示例4: SetMatrices//-----------------------------------------------------------------------------// Desc: 设置变换矩阵//-----------------------------------------------------------------------------VOID SetMatrices(){ //建立并设置世界矩阵 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 );}
开发者ID:chenbk85,项目名称:3dlearn,代码行数:23,
示例5: D3DXMatrixPerspectiveFovLHBOOL jcd3d::jcd3d_setProjectionPerspectiveTransform(LPDIRECT3DDEVICE9 lpd3dd, INT windowWidth, INT windowHeight){ if(lpd3dd == NULL) { return NULL; } else { D3DXMATRIX out; D3DXMatrixPerspectiveFovLH(&out, D3DX_PI * 0.5f, (FLOAT)windowWidth / (FLOAT)windowHeight, 1.0f, 1000.0f); if(FAILED(lpd3dd->SetTransform(D3DTS_PROJECTION, &out))) { return FALSE; } else { return TRUE; } }}
开发者ID:chengkehan,项目名称:lab,代码行数:20,
示例6: D3DXMatrixLookAtLH//------------------------------------------------------------------// Storm3D_Camera::ApplyMirrored//------------------------------------------------------------------void Storm3D_Camera::ApplyMirrored(){ // Create View matrix D3DXMatrixLookAtLH(&mv,(D3DXVECTOR3*)&position, (D3DXVECTOR3*)&target,(D3DXVECTOR3*)&upvec); Storm3D2->GetD3DDevice()->SetTransform(D3DTS_VIEW,&mv); // Calc aspect! Storm3D_SurfaceInfo ss=Storm3D2->GetScreenSize(); float aspect=(float)ss.width/(float)ss.height; // Create Projection matrix D3DXMATRIX matProj; //D3DXMatrixPerspectiveFovLH(&matProj,fov,-aspect,1.0f,vis_range); D3DXMatrixPerspectiveFovLH(&matProj,fov,-aspect,znear,vis_range); Storm3D2->GetD3DDevice()->SetTransform(D3DTS_PROJECTION,&matProj); // Multiply matrices to get VP (view-projection) matrix vp=mv*matProj;}
开发者ID:DeejStar,项目名称:Jack-Claw,代码行数:23,
|