Hey everybody,
I thought it was time to update the camera in my 3D level editor.
Here is the code:
// Space to Change flight mode
if keystate(57) = 1
if cam_flight# = 1
cam_3d_x_saved# = camera angle x(camera#)
cam_3d_y_saved# = camera angle y(camera#)
cam_flight# = 0 : wait 500 // Wait is temporary!
show mouse
hide sprite crosshair_spr#
else
cam_flight# = 1 : wait 500 // Wait is temporary!
rotate camera cam_3d_x_saved#, cam_3d_y_saved#, 0
hide mouse
show sprite crosshair_spr#
endif
endif
if cam_flight# = 1
// Camera Mouse Control
inc cam_3d_x#,mousemovey()
inc cam_3d_y#,mousemovex()
if cam_3d_x# > 90 then cam_3d_x# = 90
if cam_3d_x# < -90 then cam_3d_x# = -90
rotate camera camera#, wrapvalue(cam_3d_x#), wrapvalue(cam_3d_y#), 0
endif
The camera enters and leaves mouse look upon pressing the space key. in mouse look, the camera angles are controlled through the mouse. Works good!
The problem I have is, whenever I enter mouse look, the camera 'snaps' the camera angles to the position of the mouse, before centring it (I guess).
I've ordered the code in different ways, experimented with conditions, tried to save and load the camera angles before the mouse controls take over... nothing worked.
Any help is much appreciated!
Regards Sph!nx
www.mental-image.net