How to move camera - ala Quake Mouse Move
- when translating the 'camera' vector, translate the 'target' vector by the same amount
- when you want to "rotate" the camera, translate the 'target' vector by the opposite of the 'camera' vector, rotate it (mouse speed*mouse movement left-right around Y axis and mouse speed*mouse movement up-down around X) and then translate by the 'camera' vector again.
I must say, though, I wouldn't use a camera-target vector system for viewing in a 3D engine because it simply isn't enough - you can't rotate the view around the camera-target vector. I recommend either adding the missing angle or rather having 3 angles (around X axis, around Y axis and around Z axis) replacing the 'target' vector.
I would say that you first just see if you can move the mouse, and target with it.....just show it in 2d on the screen so....it's always the same depth.....and when it comes to the border, then just rotate.....
or is that not what you mean?
------------------
Dance with me......
Kevin
Admin for GameDev.net.
Benjamin Tolputt
aka "Night's Eternity"
I am not a math genius, so please give me an example.
I have a camera eye x,y,z and a target x,y,z. When I press forward I want the eye to move towards the target at (n) speed and the target to move away from the eye at (n) speed. This way I never catch up to the target but I always move towards it.
When I select to look left or right I want the target to go left in view space and when I select to look right I want the target to pan to the right in view space.
Basically I want to reproduce the mouse look option in quake.
Please help.
I am using Direct3D Immediate Mode, 6.1 with Microsoft Visual C++ 6.0.
Thanks Much,
ArrogantGod
webmaster@arrogantgod.com
Kevin
Admin for GameDev.net.