Original Post
Hi
I got a third person camera (ship to target) for my space sim.
I use D3DXMatrixLookAtLH(&matView,&vPos,&vLook,&vUp) to set the view.
vUp = (0,1,0)
vLook = Ship position
vPos = 1) Ship position – target position
2) normalize vPos
3) scale vPos according to zoom value
4) add ship position to vPos
It work well when my ship is not moving. But when i give it some speed, i got a proportional offset (speed / screen position). The ship is supose to be always right in the middle of the screen but at some point, it’s no longer on the screen!
I double check the data and everything seem ok. The camera is the last thing i process in my render function.
Do i build the lookAt matrix correctly? Or if it''s not that, someone have an idea how to fix this problem?