Original Post
I've been making good progress with my game demo recently thanx to alot of helpful advice from my fellow gamedev.net goers so I just wanna say thanx for all the help!! Now I seem to have ran into a little annoying glitch in my application which is causing my alot of aggravation because I can't seem to figure it out.. So far my game engine sets up a camera, sets up a stage which is a 3D mesh loaded in from an .x file at position (0,0,0) and positions the camera in the stage at position (0,50,-25) looking at position vector (0,50,0) with the default up vector.. I have a method in my code which sets up the camera like this..: Game::SetupCam(LPDIRECT3DDEVICE9 pDev) { D3DXVECTOR3 vEyePt = Cam->GetPosition(); D3DXVECTOR3 vLookAtPt = Cam->GetLookAtPt(); D3DXVECTOR3 vUpVec = Cam->GetUp(); D3DXMATRIXA16 matView, matProj; float fAspect = 800 / 600; float fFov = (float)D3DX_PI/6.2f; D3DXMatrixPerspectiveFovLH(&matView, fFov, fAspect, 1.0f, 600.0f); D3DXMatrixLookAtLH(&matView, &vEyePt, &vLookAtPt, &vUpVec); pDev->SetTransform(D3DTS_VIEW, &matView); pDev->SetTransform(D3DTS_PROJECTION, &matProj); } Now I call this method when I initially setup the scene, when the device is restored (e.g. window resize) and also each time the position of the camera changes.. The problem is the visual position of my camera changes each time I load up the app to the last.. I don't understand what is causing such dynamic variation from one instance to the next and out of all my values none seem to be dependant on any possible changing variable in my code.. I thought maybe it could have been the position/scale of the environment mesh I loaded into the scene from the .x file but it doesn't look like it since the code I used I got from the MS SDK tutorial and there doesn't seem to be any variation in size or scale when I load up that sample.. I was thinking maybe it could be an issue of how the computer calculates D3DX_PI when casted with the (float) operator but I debugged it and it seemed to give the same value (at least to 4 decimal places) each time without any signs of variation.. I really need some advice on this as to what I could check out next.. :( Also to add to that i've got a problem as when I resize the window, on restoring the device the camera position and projection seems to revert back completely to default ignoring my call to SetupCam() in my OnRestoreDevice() function.. I'm just confused and all out of ideas.. Hopefully someone can help my thik of something I haven't thought of yet..