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.

DarkBASIC Discussion / Mouselook?

Author
Message
reptilezero
21
Years of Service
User Offline
Joined: 23rd Jan 2003
Location:
Posted: 23rd Jan 2003 23:19
Hi, I'm new to programming in darkbasic I've been messing around with it for a few days now, and I understand how to load objects rotates them, and move the camera around. I've run into a small problem though! I'm using the mouse to trun the camera left and right, and that works fine. The problem occurs when I press the right mouse button which is supposed to move the camera forward. It seems like the camera is looking in one direction, but not actually rotating the camera to the new position; so no matter what direction the camera is looking in, it always moves "forward" in the same direction! I tried using

yrotate camera angley# (angley# is set to camera angle y())

but that seems to conflict with my code that lets you use the mouse to look left and right:

turn camera left mouselooky# - mousemovex()
turn camera right mouselooky# + mousemovex()

the camera angle being outputted is also very strange. it seems to go from 0 to 90, 90 to 0, 0 to -90, and -90 back to 0. That is turning in a clockwise direction. I looked through the other pages in the forum and I didn't see any questions about this subject, so any help would be appreciated in fixing this! Thanks!
reptilezero
21
Years of Service
User Offline
Joined: 23rd Jan 2003
Location:
Posted: 23rd Jan 2003 23:42
ack!

if mouseclick() = 2 then move camera 10.0
if downkey()=1 then move camera -10.0

fixed it!
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 23rd Jan 2003 23:47
Here's my mouselook code:

reptilezero
21
Years of Service
User Offline
Joined: 23rd Jan 2003
Location:
Posted: 24th Jan 2003 07:14
Ahhh. Thanks a lot! I think this will help out a lot! Is there any sources on the net that contain tutorials on how to do stuff in DarkBASIC? The stuff in the book is a little simplistic for what I'm interested in doing Thanks for your help!

Login to post a reply

Server time is: 2024-05-05 03:59:19
Your offset time is: 2024-05-05 03:59:19