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 / Controlling a 3D Spaceship with mouse

Author
Message
Kafoolwho
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location: The Deep
Posted: 9th Nov 2013 13:01
Hi everyone. I recently started using DBPro free version, and I am having a bit of a problem with a small program I am writing.

I have been trying to get this to work for at least 2 weeks now, but the results are just BAD.

I have a 3d model flying over a terrain with a camera following it. What I want to do is be able to control the ship's flight with the mouse, I.E. Move the mouse up, it climbs, move mouse left, it banks left etc. Also, the further the mouse is moved the higher the rotation.

Also, I want the camera to always stay directly behind the ship, adopting the exact same angles on all axes as the model.

This is driving me totally insane! Please, any help will be very much appreciated.
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 9th Nov 2013 23:23 Edited at: 12th Nov 2013 17:33
For the pitch control, you'll want to use MOUSEMOVEX/Y/Z in conjunction with PITCH OBJECT UP/DOWN, TURN OBJECT and/or ROLL OBJECT

For camera placement centered behind your object try using SET CAMERA TO FOLLOW or something manual like:



D.D.
Kafoolwho
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location: The Deep
Posted: 11th Nov 2013 12:19
Thank you very much, Derek Darkly.

The camera code you provided definitely did the trick for the camera following the ship.

I still don't have the ship movement working correctly, but I'll experiment some more.
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 12th Nov 2013 17:35 Edited at: 12th Nov 2013 17:35
Glad I could be of help.

I corrected my code by replacing the "MOVE CAMERA UP" which is not actually a command but something I imagined. LoL

D.D.

Login to post a reply

Server time is: 2024-04-18 19:44:47
Your offset time is: 2024-04-18 19:44:47