This is my first time on these boards, so hello all! I am a DirectX noob, so plz bare with me :P
Anyway, I am basically making a 2D pathfinding project and I want to be able to zoom in and out along the z-axis, depending on the size of the map loaded. I have learned the basics of displaying sprites, but haven't touched anything with the camera as of yet...
So from a few hours of searching this is all I've been able to come up with.
I am putting this code in my initilization function of DirectX. I assume that this is setting up camera to look along the z-axis?
D3DXVECTOR3 vEyePt( 0.0f, 0.0f,-5.0f );
D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f );
D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f );
D3DXMATRIXA16 matView;
D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
D3DXMATRIXA16 matProj;
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 1000.0f );
g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
And, then in my rendering function (I guess just to see if I can make the camera change) I have this
D3DXMATRIX matView;
D3DXMATRIX matTrans;
D3DXMatrixTranslation( &matTrans, 0.0f, 0.0f, -5.0f );
matView = matTrans;
g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
This doesn't change anything :( I know this is probably really simple, but any help for a noob would be greatly appreciated!
[Edited by - Sk1d_Row on October 22, 2005 7:18:43 PM]