3D Flight Simulator

L

Lee Hartsell

Guest
Greetings, all!

I'm in my second semester here at wake tech learning simulation and game design. Unfortunately, it seems I may have taken a level 200 class to soon, or at least, the classes before hand haven't adequately prepared me for this one. (This is a known issue, and has recently been discussed with us the students and the teacher.)

Nonetheless, we're on to the next project, in which we must make a vehicle simulator. I have been saddled with the role of programmer. As a more artistic person, and someone who is more interested in design, I fear this is well beyond my scope.

Anyway, now that the whining is out of the way; let's get down to business.

The plan for our group is to make an f-16 flight simulator.

I want to use game maker's 3D capabilities for this, and so far have used code from a YouTube tutorial to generate a scene, with lighting, fog, and simple keyboard controlled movement and mouse controlled rotation. However, I'd rather the movement be controlled by the mouse, and obviously be three dimensional.

Of course, I've done a bit of research, and I've looked a bit into something called quaternions. These math functions seem to be able to help with creating 3D flight. I am here simply asking for guidance and assistance in how 3D flight might be imitated in game maker using quaternions, (or any other method, really).

I am aiming for a movement scheme similar to World of Warcraft's when using a flying mount, where the mouse still controls the camera, but simultaneously clicking each mouse button will move the camera forward. The only other issue I'd like help with is attaching an image to the camera (the cockpit).

I'll post the code for camera control:

-----
direction-=(display_mouse_get_x()-display_get_width()/2)/10;
pitch=clamp(pitch+(display_mouse_get_y()-display_get_height()/2)/10, -80, 80);

display_mouse_set(display_get_width()/2, display_get_height()/2);

if (keyboard_check(vk_escape))
game_end();

var d=degtorad(direction);

switch (keyboard_key){
case vk_left:
case ord('A'):
x-=sin(d)*16;
y-=cos(d)*16;
break;
case vk_down:
case ord('S'):
x-=cos(d)*16;
y+=sin(d)*16;
break;
case vk_right:
case ord('D'):
x+=sin(d)*16;
y+=cos(d)*16;
break;
case vk_up:
case ord('W'):
x+=cos(d)*16;
y-=sin(d)*16;
break;
}
-----

Now, I understand I may be asking a lot here (and maybe skirting the rules a bit) for help with something as complex as 3D flight, but I've only got 3 weeks to make this game, and I have only some experience with programming, a little with game maker, and none with game maker 3D. So, as you can imagine, I've already hit the panic button.

That said, I am likely going to speak to my teacher about feeling ill prepared for this class and this particular project. Nonetheless, timely help with this matter will be greatly appreciated. Already I am tinkering with code to try and get results, but professional or more experienced guidance is sorely needed.

Thanks a ton,
Lee
 
Top