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 Professional Discussion / Navigation Problem

Author
Message
XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 4th Jan 2012 21:44
I've been working on this for days. The problem is, well the ship navigates fine, but if it hits a certain angle like when I pull up, and I want to go left...well, the ship banks to the left but it turns to the right.

Using this code, I would preferable just ignore turning left or right in space, and just allow for a roll and up/down, the player can then make his turns by using a combination. I wouldn't mind if the ship didn't bank away from the camera since I will probably remove the object anyway, but i'd still like it to be available for multiple views. Anyway, here is the pieces of the code that should be relevant. I'm actually using the GDK, but I can translate since the problem lies in both versions. The entire program is available here http://forum.thegamecreators.com/?m=forum_view&t=169615&b=1, I released it as open source some time ago and am now making changes for a different game altogether.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 5th Jan 2012 03:27
Instead of using ROTATE OBJECT and XROTATE OBJECT, etc, try using commands such as PITCH OBJECT UP, ROLL OBJECT LEFT, etc, as they rotate the object relative to its direction, rather than relative to the world space.


felixjsc
14
Years of Service
User Offline
Joined: 3rd Jan 2012
Location:
Posted: 5th Jan 2012 03:38
Thanks for your advice, your method maybe can solve this problem.

you and me
XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 5th Jan 2012 14:48
I started messing with the pitch commands last night, this is the solution. The code is in vb.net, but also works in DBP as that is where is tested it. I never would have thought to subtract an upkey from a downkey, i'm not even sure how it works but it does. Here's the code for anybody else with the same problem.



Login to post a reply

Server time is: 2026-07-10 01:06:51
Your offset time is: 2026-07-10 01:06:51