the problem is, when I'm getting close to looking straight up, the sensativity of the mouse (or camera) goes down alot. (I'm moving the mouse alot more to get less movement in the camera). Does anyone know how to fix this?
first person mouse looking bug
Started by DudeGuy676, Jun 26 2012 07:51 PM
5 replies to this topic
#1
Posted 26 June 2012 - 07:51 PM
I've recently started learning how to program in 3d, and so far I've developed this code for using the mouse to look around
the problem is, when I'm getting close to looking straight up, the sensativity of the mouse (or camera) goes down alot. (I'm moving the mouse alot more to get less movement in the camera). Does anyone know how to fix this?
Spoiler
the problem is, when I'm getting close to looking straight up, the sensativity of the mouse (or camera) goes down alot. (I'm moving the mouse alot more to get less movement in the camera). Does anyone know how to fix this?
#2
Posted 26 June 2012 - 08:54 PM
Divide the horizontal rotation by cos(obj_camera.zdirection)
Note: When using this method, never look straight up.
Note: When using this method, never look straight up.
#3
Posted 26 June 2012 - 09:44 PM
I tried that and it ended up with very chaotic results. The point of this is to actually be able to look straight up withought the camera spinning out of control.
#4
Posted 27 June 2012 - 02:34 AM
Ah. Not sensitivity.I tried that and it ended up with very chaotic results. The point of this is to actually be able to look straight up withought the camera spinning out of control.
You'll want to modify the up vector for the projection.
#5
Posted 27 June 2012 - 02:42 AM
Ah. Not sensitivity.
You'll want to modify the up vector for the projection.
could you please elaborate? I tried a number of things and they all failed.
#6
Posted 27 June 2012 - 10:26 PM
When the look vector <xto-xfrom,yto-yfrom,zto-zfrom> is parallel to the up vector <xup,yup,zup>, d3d has no means of determining the intended orientation. A simple way (Not the best way, but should work for your purposes) is to change the up vector from <0,0,1> to <cos(direction)*(yfrom-yto),sin(direction)*(yfrom-yto),1>. This will allow the camera to function even when facing straight up or straight down.
Ah. Not sensitivity.
You'll want to modify the up vector for the projection.
could you please elaborate? I tried a number of things and they all failed.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











