'Orthographic FPS Camera
I'm looking into making an FPS orthographic camera. All the resources I read basically only point only to orbit/track ball cameras since there is the problem of zoom in orthographic cameras (diving the x and y axis by a zoom factor to simulate zooming). I was wondering if anybody has come up with a more complex solution that allows fps navigation or free camera navigation in general while using an orthographic view?
Here is my current orthographic matrix:
void Matrix_ScreenOrtho ( Matrix *pOut, f32 a_fVFov, f32 a_fZoom, u32 a_dwWidth, u32 a_dwHeight, f32 a_fZNear, f32 a_fZFar )
{
f64 fHalfVFov = (f64)a_fVFov * (f64)DEG2RAD * 0.5;
f64 fProjHeight = tan ( fHalfVFov ) * a_fZoom;
f64 fAspect = (f64) a_dwHeight / (f64) a_dwWidth;
Matrix_Init ( pOut );
pOut->c._11 = ( 2.0f * fAspect ) / ( fProjHeight );
pOut->c._22 = 2.0f / ( fProjHeight );
pOut->c._33 = 1.0f / ( a_fZFar - a_fZNear );
pOut->c._43 = ( a_fZNear + a_fZFar ) / ( a_fZNear - a_fZFar );
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|