Original Post
Hi, I have a texture that appears in the top right hand quad of my screen. This is correct given the vertex buffer I am using. Basically I need the correct matrix conversion that will take those vertices and map them into my screen with the top left hand corner of the screen being (0,0) and the bottom right hand corner being (800,800). I realise that all I need to do is subtract 1.0 from the 2/width and 2/height setting that multiplies the X and Y of a vertex. I use this call: D3DXMatrixOrthoLH(&matOrtho, 800.0f, 800.0f, 0.1f, 10.0f) which essentially gives me an origin at the middle of the screen (and not the top left hand corner - which in texture space is (-1,1). I tried augmenting this matrix with : matOrtho._12 = -1.0f; matOrtho._21 = -1.0f; to get the -1 subtraction which I need. This doesn't work. Any ideas how I can get my mapping? Cheers, Chris Code: --------------------------------------------------------------------- Vertex buffer: #define D3DFVF_CUSTOMVERTEX ( D3DFVF_XYZ | D3DFVF_TEX1 ) Vertex g_quadVertices[] = { { 0.0f, 0.0f, 5.0f, 0.0f, 0.0f }, // TLHCorner { 800.0f, 0.0f, 5.0f, 1.0f, 0.0f }, // TRHCorner { 0.0f, 800.0f, 5.0f, 0.0f, 1.0f }, // BLHCorner { 800.0f, 800.0f, 5.0f, 1.0f, 1.0f } // BRHCorner }; --------------------------------------------------------------------- Camera projections: D3DXMATRIX matOrtho; D3DXMATRIX matIdentity; D3DXMatrixOrthoLH(&matOrtho, 800.0f, 800.0f, 0.1f, 10.0f); D3DXMatrixIdentity (&matIdentity); g_pd3dDevice->SetTransform (D3DTS_PROJECTION, &matOrtho); g_pd3dDevice->SetTransform (D3DTS_WORLD, &matIdentity); g_pd3dDevice->SetTransform (D3DTS_VIEW, &matIdentity); g_pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);