Camera Movement

Ok, so I figured out how to move the camera with the keyboard.

Now I wanna know how I can move it with the mouse!

I want to be able to change the camera's Target using the mouse, and position using the keyboard (FPS style).

I read some of the samples in which comes with SDK, but I could not figure out really which part was essential for moveing the camera.

Please help me on this one =)

thx

[404 byte] By [CruS] at [2008-2-17]
# 1
There is a basic class in the SDK sample framework called CFirstPersonCamera, which you'll find in the samples\c++\common\dxutmisc.cpp file. That's a starting point, however it relies on the user clicking and dragging, and is limited to the available range on screen coordinates.

If you want to implement a camera with unrestrained mouse-look functionality, you'll want to use the DirectInput to read the mouse in relative mode, which reports mouse movement as a position delta and is not tied to the screen coordinates.

--
Robert Dunlop
The X-Zone
http://www.directxzone.com/
Microsoft DirectX MVP
-
The opinions expressed in this message are my own personal views and do not reflect the official views of the Microsoft Corporation.
The MVP program does not constitute employment or contractual obligation with Microsoft.

RobertDunlop at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2

Having been familiar with older revs of directx in a past lifetimes and having written my own camera code a few times nowand coming up to speed on DX again- the demos and documentation in the latest SDK's don't do a lot of justice to taking advantage of the helper functions.

I'm looking at either re-inventing the wheel as well or ciphering through the camera code... so far it's been a wash in terms of which is easier.

Don't get me wrong- the code is brilliant, however the documentation/demos are leaving a bit to be desired.

andymaris at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...