Working on it; I'll edit this post when I figure it out. Is what you're looking for a way to change the panning speed depending on how fast you're moving the mouse?

If so, this might help:

Create a variable to handle 'acceleration'. "camera_accel", is an example of a good name. This variable will remain at 0 when you aren't dragging, but will be given a value depending on mouse_force's value.

So if mouse_force == 0 then camera_accel would be 0 as well,

if (mouse_force >= 2 && mouse_force < 4) {camera_accel = 4;}
if (mouse_force <= 2 && mouse_force < -4) {camera_accel = -4;}

Do you get the idea? We're changing the acceleration value based upon the value of mouse_force (how fast we are moving the mouse).

For a basic panning camera:

Some people try something like:

camera.x = mouse_force.x * 5;

That doesn't work, and when you take a look at it the reason is fairly obvious; the camera's x value is going back to zero again because that's the value of mouse_force when the mouse isn't being moved.

The trick is to ADD the mouse_force to the camera.x, not SET camera.x to be equal to mouse_force. You could to it the same way with the keyboard:

if (key_cul == 1) {camera.x -= 5}

That's an example of what I mean.
--------------------------------------
Or: It might simply be because your statements are in a while loop. If you find your movement being really oversensitive, try taking it out of a while loop.


I hope this helped you, bye! ^^

P.S: to PAN the camera in 3DGS often means to turn it as if it's spinning on a pole (with it's z axis), not to pan it across an area like you would in Black and White.

Last edited by Max_Prower; 08/15/09 00:06.