Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
I need a little help on my flight simulator
Old
p58mustang
Guest
 
Status:
Posts: n/a
Default I need a little help on my flight simulator - 12-27-2006, 12:52 PM

I am creating a flight simulator. I have it set up so that the arrow keys make the T3A plane turn forward, backward, left, right, etc. It works fine but it looks fake when the plane is going straight forward while it is banked to one side. I was wondering how you make the plane turn left when you bank to the left and turn right when you bank to the right.

If I know the plane's current bank angle, then I can figure out how much to make it turn, but how do I find out the current bank angle? Can I get it from the T3A's "current pose" function? What does that function return? More generally, how do I find out what any built-in method or function does, such as the T3A's quaternion function? Is there documentation somewhere that I can read?

If anybody has some time I would like some help. thanks

Last edited by p58mustang; 12-28-2006 at 11:18 AM. Reason: I forgot to put in a word
   
Reply With Quote
Here is my flight simulator program
Old
p58mustang
Guest
 
Status:
Posts: n/a
Default Here is my flight simulator program - 12-28-2006, 11:09 AM

If you would like to look at my program you can download it. Also if you'd like to make any suggestions on how to make it better, please do.
Attached Files
File Type: a2w Flight simulator.a2w (3.59 MB, 743 views)
   
Reply With Quote
Some thoughts - probably not much help.
Old
DrJim
Guest
 
Status:
Posts: n/a
Red face Some thoughts - probably not much help. - 12-28-2006, 09:33 PM

Thanks for posting the code - it's really a nice piece of work.

Concerning having the plane bank as it turns - really not sure what you want to do. Isn't this something a pilot has to control with a combinatin of rudder and flaps - essentially something you already have with separate turn and roll controls? You could link the two - see attachment - but I don't know if this would make it more realistic.

Re poses, quaternions, etc. - I haven't seen much documentation on them that relates to Alice. About the best you can do is print out the values while you run the worlds and try to make some sense of them.

Don't think you want to work with the pose data - it seems to be a set of local coordinates for all of the sub-objects in the object tree. The point of view is the combinatin of position and orientation (quaternion) for the entire object and might give you what you want.

At least for me, however, quaternion-based math for 3-D calculations (see http://en.wikipedia.org/wiki/Quaternion) is far from obvious (think you would need the CMU math pack or an equivalent to do much). I think you would do better to force the relationships you need than to try to react to current values.
Attached Files
File Type: txt Flight simulator's Code.txt (547 Bytes, 509 views)

Last edited by DrJim; 12-30-2006 at 07:52 PM.
   
Reply With Quote
(Source for) A bit more help.
Old
DrJim
Guest
 
Status:
Posts: n/a
Cool (Source for) A bit more help. - 12-30-2006, 07:57 PM

Ran across this link which might be helpful: http://www.gamedev.net/community/for...age=1&#1971610

The math doesn't get any easier but there is a pretty good discussion of the general subject of roll, pitch and yaw and also sample code for conversion between these three angles and quaternions - plus lots of other links.
   
Reply With Quote
I'll try it
Old
p58mustang
Guest
 
Status:
Posts: n/a
Default I'll try it - 12-31-2006, 09:57 AM

thanks
   
Reply With Quote
Old
bomberchia
Guest
 
Status:
Posts: n/a
Default 06-26-2007, 06:33 AM

okay.. i modified the game alittle to allow more user interaction. I still cant get to do collision detection when the plane hits the ground though. so i would love your comments.
Attached Files
File Type: a2w Flight Simulator.a2w (1.51 MB, 481 views)
   
Reply With Quote
Nice aircraft control (and a couple hints).
Old
DrJim
Guest
 
Status:
Posts: n/a
Thumbs up Nice aircraft control (and a couple hints). - 06-26-2007, 12:27 PM

First of all - nice game, especially the aircraft controls which have a very real feel , and also very nice comments. It's a pleasure to read code and be able to easily see what the programmer intended for each section.

One hint - if you are going to look for collisions with the ground, I would set the ground's "isFirst Class" parameter (under "Seldom Used Properties") to "false" - which will mean it cannot be selected by the mouse. This will keep you or anyone else from moving the ground accidentally.

What you want to do is add a test to see that the T3A's distance above ground is greater than zero. What the "above ground" test does is test against the whole ground plane, as apposed to a "distance to" test which only tests center-to-center spacing and hence doesn't work well for something like this.

If the test is true, the game should run normally. If false, do whatever you want for a crash. You can either just have the game run (with an event while) until a crash or use an if/else statement inside the main loop to switch to a different scenerio after a crash. (I attached a (very poor ) example to give you the general idea, but I'm sure you can do much better.)
Attached Files
File Type: a2w Flight Simulator Rev.a2w (1.51 MB, 466 views)
   
Reply With Quote
landing
Old
Syedkidd
Guest
 
Status:
Posts: n/a
Default landing - 11-11-2009, 08:15 PM

I know how to make it crash, but how do you make the airplane land without crashing, like i want it to crash if it hits the ground, but not if it lands
   
Reply With Quote
Help with Flight simulator
Old
jayjjj3
Guest
 
Status:
Posts: n/a
Default Help with Flight simulator - 11-11-2009, 11:37 PM

I seriously need help in my flight sim, i need to make collisions with over 2000 objects, and also be able to change airplanes, and also land.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.