|
|
我想改变sprite的zbuffer,但不知道为什么,怎样设置都不是在我场景当中最前面,如果我吧D3DXMatrixTransformation的tanslations 的z改成1,那sprite 报道整个场景的最后面了...怎样才能把sprite设置到场景当中呢?
...
g_pDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
D3DXMatrixLookAtLH(&matView,&D3DXVECTOR3(campos.x, campos.y, campos.z),//Camera Position
&D3DXVECTOR3(right.x, right.y,right.z), //Look At Position
&D3DXVECTOR3(dir.x,dir.y, dir.z)); //Up Direction
D3DXMatrixTransformation(&vMat, NULL, NULL, &D3DXVECTOR3(1.0f,1.0f, 1.0f), &D3DXVECTOR3(50.0f,50.0f, 50.0f),NULL, &D3DXVECTOR3(200.0f,500.0f,1.0f));
D3DXMatrixScaling(&faceUsermat,0.01f,-0.01f,0.01f);
D3DXMatrixMultiply(&matTrans, &matTrans, &matScale);
D3DXMatrixMultiply(&matView, &matView, &matTrans);
g_pDevice->SetTransform(D3DTS_VIEW, &matView);
g_pSprit->Begin(D3DXSPRITE_ALPHABLEND);
g_pFont->DrawText(g_pSprit,_T("大小多少"),-1,NULL,DT_TOP|DT_LEFT|DT_VCENTER,0xffffffff);
g_pSprit->End();
.....
|
|