Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - Snippets!! Ill start first

Author
Message
DARKBASIC PRO 3d WORLD EDITOR
5
Years of Service
User Offline
Joined: 2nd May 2012
Location:
Posted: 20th May 2015 10:14
function INI_ControlCameraWithMouse(cam_num,mouse_lock)
mx#=mousemoveX()
my#=mousemoveY()
mz#=mousemoveZ()
if mouse_lock=1
yrotate camera camera angle y(cam_num)+mx#
xrotate camera camera angle x(cam_num)+my#
endif
cx#=camera position x(cam_num)
cy#=camera position y(cam_num)
cz#=camera position z(cam_num)
position camera cam_num,cx#,cy#+(mz#*.1),cz#
if mouse_lock=1
position mouse screen width()/2,screen height()/2
if mouseclick()=1
move camera cam_num,1
endif
endif

if mouseclick()=2
select mouse_lock
case 0: mouse_lock=1: endcase
case 1: mouse_lock=0: endcase
endselect
nice wait no mouse
endif
endfunction

- Infinity is Simplicity -

Login to post a reply

Server time is: 2017-07-23 01:31:45
Your offset time is: 2017-07-23 01:31:45