a stupid cam problem..

Blitz3D Forums/Blitz3D Programming/a stupid cam problem..

Spy(Posted 2004) [#1]
hey,


ok i have this wierd problem with CameraZoom.. i want to zoom the cam when shift is pressed and MouseZSpeed() changes.. so i use this.. (there are 4 cams on the screen btw.)..

If KeyDown(42) Then
CAM1_ZoomValue#=CAM1_ZoomValue# + MouseZSpeed()
CameraZoom CAM1,CAM1_ZoomValue#
End If

ok this works .. BUT.. if i dont hold SHIFT but scroll with the mouse scroller.. and then press SHIFT (after i stopped scrolling) the camera zooms.. i dont know why it zooms but it does.. there was no way CAM1_ZoomValue# could change without holding SHIFT.. so any ides why it zooms suddendly after scrolling without holding shift?


jfk EO-11110(Posted 2004) [#2]
MouseZSpeed delivers the last speed measured.

try this:
if keydown blaba
zoom etc
else
dummy#=cameraZSpeed()
endif

or use Flushmouse


Jeppe Nielsen(Posted 2004) [#3]
do this:
zspeed=MouseZSpeed()
If KeyDown(42) and zspeed
CAM1_ZoomValue#=CAM1_ZoomValue# + zspeed 
CameraZoom CAM1,CAM1_ZoomValue# 
End If 



jfk EO-11110(Posted 2004) [#4]
uh yeah, that's the correct way for all those mouse values: grab them one time and then use the variable. This way the speed is read each loop too.


Spy(Posted 2004) [#5]
thank you.. that works :-)