m_position is the camera position in world space.
//update the frustum corners in order for the deferred renderer to reconstruct the world space position void updateFrustumCornersInfos() { D3DXVECTOR3 fc = m_position + m_viewDir*m_fZFar; //far plane center pos in world space D3DXVECTOR3 nc = m_position + m_viewDir*m_fZNear; //near plane center pos in world space float halfWFar = m_fWidthFar*0.5f; float halfHFar = m_fHeightFar*0.5f; float halfWNear = m_fWidthNear*0.5f; float halfHNear = m_fHeightNear*0.5f; //far plane frustum corners in world space m_fFrustumCorners[eFC_FTR] = fc + (m_up*halfHFar)+(m_right*halfWFar); m_fFrustumCorners[eFC_FTL] = fc + (m_up*halfHFar)-(m_right*halfWFar); m_fFrustumCorners[eFC_FBR] = fc - (m_up*halfHFar)+(m_right*halfWFar); m_fFrustumCorners[eFC_FBL] = fc - (m_up*halfHFar)-(m_right*halfWFar); //near plane frustum corners m_fFrustumCorners[eFC_NTR] = nc + (m_up*halfHNear)+(m_right*halfWNear); m_fFrustumCorners[eFC_NTL] = nc + (m_up*halfHNear)-(m_right*halfWNear); m_fFrustumCorners[eFC_NBR] = nc - (m_up*halfHNear)+(m_right*halfWNear); m_fFrustumCorners[eFC_NBL] = nc - (m_up*halfHNear)-(m_right*halfWNear); }