DirectX programing C# (Camera rotation)
-
Help..Help...Help.. :zzz: Hi My name is Debjit ,I am trying move and rotate a Camera in a 3d sean.I am programing in C# using DirectX SDK.The problem is that when I rotate the camera and try to move the camera forward in z direction it goes z direction but facing on some other side because of the target position. I know that i am not so clear but if anyone understood please help me. Thanks Debjit_625 Debjit_625
-
Help..Help...Help.. :zzz: Hi My name is Debjit ,I am trying move and rotate a Camera in a 3d sean.I am programing in C# using DirectX SDK.The problem is that when I rotate the camera and try to move the camera forward in z direction it goes z direction but facing on some other side because of the target position. I know that i am not so clear but if anyone understood please help me. Thanks Debjit_625 Debjit_625
What you mean saying the camera is "facing on some other side"? Actually, you didn't write what you want to achieve. Do you want the camera to point always the same direction? If so, you may need to recreate projection matrix, which contains the look at point of the camera. Direction vector of the camera is :
dir = lookAt - position
. After you store it, you can calculate new look at point from any position:newLookAt = newPosition + dir
Did I help you?