Original Post
I think this is a simple formula, but I can''t find a reference to it at the moment, probably one that is asked for a lot...
I have a perspective camera set up...
D3DXMATRIX matProj; // Set the projection matrix FLOAT fFOV = D3DX_PI/3; FLOAT fAspect = m_d3dsdBackBuffer.Width / (FLOAT)m_d3dsdBackBuffer.Height; D3DXMatrixPerspectiveFovLH( &matProj, fFOV, fAspect, 10.0f,12000.0f); m_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj ); //given x & y, //need to find, Position( x, y, z ), fWidth, fHeight // such that a pixel in the texture file, is a pixel on the screenNow, what I am trying to solve for is the distance away from the camera such that a pixel in a texture for a 2d billboard floating in world space is still a pixel... What I mean is, I have a texture mapped to a dynamic billboard. And I am trying to put this billboard at location P( x, y ) where x and y is in pixels, but I can''t figure out how far away from the camera the billboard has to be such that a pixel remains a pixel.... Any ideas?