I've got a bit of code written to rotate the camera as I move the mouse, just like being in a third person game, but only, it's for a map editor. I want to reproduce a Maya or 3dsmax type "perspective" view environment. The problem is, the rotation is wobbly, like it's moving in a sine wave (understandble, but not desirable) I have no clue how to get rid of it, here's a snippet of my code, if you need anymore just yell. :) Thanks.
Function UpdateCamera()
Mouse_X_Speed#=MouseXSpeed()*0.075
Mouse_Y_Speed#=MouseYSpeed()*0.075
MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
Camera_Pitch#=Camera_Pitch#+Mouse_Y_Speed#
Camera_yaw#=Camera_yaw#-Mouse_X_Speed#
TurnEntity cam_target, Camera_Pitch#, Camera_yaw#, 0
smoothcam(pivot_cam,sphere,2)
End Function
Function smoothcam(pivot,target,camspeed)
curx#=EntityX(persp_cam)
cury#=EntityY(persp_cam)
curz#=EntityZ(persp_cam)
destx#=EntityX(pivot_cam, True)
desty#=EntityY(pivot_cam, True)
destz#=EntityZ(pivot_cam, True)
curx#=curx#+((destx#-curx#)/camspeed)
cury#=cury#+((desty#-cury#)/camspeed)
curz#=curz#+((destz#-curz#)/camspeed)
PositionEntity persp_cam,curx#,cury#,curz#
PointEntity persp_cam,target
End Function
Function UpdateCamera()
Mouse_X_Speed#=MouseXSpeed()*0.075
Mouse_Y_Speed#=MouseYSpeed()*0.075
MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
Camera_Pitch#=Camera_Pitch#+Mouse_Y_Speed#
Camera_yaw#=Camera_yaw#-Mouse_X_Speed#
TurnEntity cam_target, Camera_Pitch#, Camera_yaw#, 0
smoothcam(pivot_cam,sphere,2)
End Function
Function smoothcam(pivot,target,camspeed)
curx#=EntityX(persp_cam)
cury#=EntityY(persp_cam)
curz#=EntityZ(persp_cam)
destx#=EntityX(pivot_cam, True)
desty#=EntityY(pivot_cam, True)
destz#=EntityZ(pivot_cam, True)
curx#=curx#+((destx#-curx#)/camspeed)
cury#=cury#+((desty#-cury#)/camspeed)
curz#=curz#+((destz#-curz#)/camspeed)
PositionEntity persp_cam,curx#,cury#,curz#
PointEntity persp_cam,target
End Function