DirectX Camera

Does anyone have any experience in DirectX? I am currently using DirectX9 and trying to place the camera such that location 0,0 is in the bottom left of the screen.

This puts 0,0 in the center of the screen:

1
2
3
4
5
6
7
8
9
10
11
12
 void SetUpCamera(LPDIRECT3DDEVICE9 p_dx_Device){
     D3DXVECTOR3 m_EyePos(0, 0, -30);
     D3DXVECTOR3 m_TargetPos(0, 0, 0);
     D3DXVECTOR3 m_UpVector(0, 1, 0);
     D3DXMATRIXA16 m_View;
     D3DXMatrixLookAtLH(&m_View, &m_EyePos, &m_TargetPos, &m_UpVector);
     p_dx_Device->SetTransform(D3DTS_VIEW, &m_View);
 
     D3DXMATRIX m_Projection;
     D3DXMatrixPerspectiveFovLH(&m_Projection, D3DX_PI/4, 500/500, 1, 50);
     p_dx_Device->SetTransform(D3DTS_PROJECTION, &m_Projection);
 }


Any help would be appreciated.
As i can see this is not the whole program, is it ?

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Last edited on
Your slashes don't exactly help.
>>the whole program, is it?
No that is a snippet. It is just the function that sets up the camera.
Topic archived. No new replies allowed.