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 / Realistic space ship flight

Author
Message
tokyomage
15
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 22nd Jan 2012 16:05
Hey guys,


Im creating a space game in DBPro
and have gotten a cool effect with
the joystick commands. Though I have
not much code done on the flight part
itself, its somewhat good... But not
what I was in visioning . So all
I ask of you is some code giving a cube
a smooth flight in the air. Also, if possible using
the set camera to follow command on the cube.

Thanks guys,
-Tokyomage

.....the feel of solitude hurts inside....
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Jan 2012 17:06
Check out my library of useful functions, it has an example in it with an aeroplane flying around:

http://forum.thegamecreators.com/?m=forum_view&t=190374&b=1

This is a stripped down version of the code:



What's set up here is you have a core object, object 1, and your actual model object, object 2, which is glued to limb 0 of object 1. What this does is it allows us to zrotate the model local to the rotations of the core object. The best way to set something like that up is like this:



TheComet

tokyomage
15
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 22nd Jan 2012 20:40
Hi,


Thanks but it did not work as well as it seemed.
Its kind of hard to explain... Anyway, what im trying to do
is to get the camera to follow the back of the space craft. I already got down the whole turning left and turning right thing done, I just need the camera to move along with the object at the same speed of pitching as the object. So yeah.

-Tokyomage

.....the feel of solitude hurts inside....
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Jan 2012 21:41
This should do it:



TheComet

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 23rd Jan 2012 08:49
Interesting this will be something for me to look back on for one of my small projects

Hi you two

tokyomage
15
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 23rd Jan 2012 21:33
Hi,


Sadly it still did not work, heres what I put as
variables for the code you gave me:


thanks,


-Tokyomage

.....the feel of solitude hurts inside....
tokyomage
15
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 23rd Jan 2012 21:34
And by chance, could you
use your code (make an example) in an example?
I think that would let me understand it way better.

thanks,

-Tokyomage

.....the feel of solitude hurts inside....
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Jan 2012 23:27


TheComet

tokyomage
15
Years of Service
User Offline
Joined: 26th Sep 2010
Location: on your roof
Posted: 24th Jan 2012 01:25
Hi,


@The comet thanks, looks great. I like it
a lot . If possible, can the plane have free direction
of flight as in it can turn all the way instead of having
the limitation of height? I mean like if you press the down key
you know how the plan flys down? well Im trying to get the
plane to keep going down and enable it to go in a complete
circle and have the camera follow it no matter what angle.
Thanks a lot .

-Tokyomage

.....the feel of solitude hurts inside....
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 24th Jan 2012 07:04
Thinking again EZRotate has a demo flight sim... and does precisely what you are looking for...

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Jan 2012 09:35
All you need to do is take out the xrotate limits. Something like this:



And then take away this line so it doesn't reset to 0:



I'm not going to spoon feed you. You need to experiment yourself with it. If you aren't able to, then you're probably not ready for a 3D space flight game.

TheComet

Captain Chucky
14
Years of Service
User Offline
Joined: 5th Feb 2012
Location:
Posted: 5th Feb 2012 09:55
I usually use one of these methods. This first is a lot smoother, but the axis gets reversed after doing a 180 loop. This code goes inside the loop.



Login to post a reply

Server time is: 2026-07-11 02:55:40
Your offset time is: 2026-07-11 02:55:40