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.

Newcomers DBPro Corner / Flying with the mouse and cursor keys

Author
Message
alanuk
21
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 12th Apr 2003 21:25
The arrow keys work fine ie, left right forward and back.

The mouse moves the camera view around the room in all directions no problem.

What I need is to be able to move the mouse so that it is pointing above or below the 'horizon' and when using the forward arrow key the height of the camera goes up or down. ie I want to fly around the room and OVER objects.

Any ideas please, cos' all this newxvalue(Z#,cameraAngleZ#,10) stuff is giving me a headache !!! :-s

regards Alan
deathAngel
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 13th Apr 2003 13:41
if i understand you correct, you want the up/down arrow keys to move
the camera up/down while the mouse pointing above/below horizon?
try:


hope it helps. (sorry for the bad english)

alanuk
21
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 13th Apr 2003 14:00
Thanks deathAngel, I will try that in my code.

regards Alan
alanuk
21
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 13th Apr 2003 16:53
No, that's not what I want to happen. I basically want to fly around the room like a plane and view the 'room' from all angles and heights.

regards Alan
The Wendigo
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 13th Apr 2003 22:22
well, let me give it a shot.



1.00 GHZ processor, 256 MB RAM, GeForce 3 64MB, SB Live!, 8 cans of soda per day
Whisper Wind
21
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 13th Apr 2003 23:57 Edited at: 13th Apr 2003 23:59
Here's a cool little addition to Wendigo's code:



Look around till you find the cubes and fly around them by changing your velocity with the up arrow and down arrow keys.
alanuk
21
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 15th Apr 2003 21:47
Thanks guys for your help. One thing I learned was that move camera could have negative values...didn't know that, so that was one problem solved.

The code below is what I have so far. It works as I want it to. You can fly around space and go forward and backwards and also straf left and right. The problem is that strafing causes a slight problem with the vertical axis. It keeps resetting to the starting values.

Try it and you'll see what I mean after you have moved forward with the up arrow key.

If anyone can offer me suggestions how to cure this I would be grateful. Spent all day at it !!

regards Alan
alanuk
21
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 15th Apr 2003 21:49
Mmmm it didn't go into the snippit box...how do I do that?

clicking on the source button displays it ok though

Alan

Login to post a reply

Server time is: 2024-09-20 06:50:10
Your offset time is: 2024-09-20 06:50:10