Flight Sim Engine using 3DSmax import and Away3D


14-06-2009 2-40-17 PM

Click to launch

I built this while at FITC Toronto.  The Speakers were quite motivating, I guess!

Click to load, once loaded, click to start. Mouse control only (maybe the control is a bit too realistic, in that it takes some time to master the roll and pitch)

The goal is to flyby all the red markers in minimum time. The fighter uses realistic elevator and aileron controls, so it is tricky to fly at first and gives an appreciation of what pilots have to master. Of course, flying in 3rd person rather than first person adds to the issue!

Details on implementation:

This is a quick minigame I put together using a low poly CF-18 hornet (about 250 polys and 3 textures). It uses a few tricks available in Away3D (and of course papervision):

1) Skybox 6 – a few lines of code to generate an environment – this is not an interactive, but rather a good way to provide a player with orientation information with a relatively low CPU overhead.Just make sure to not enable skybox.quarterFaces(), as the extra overhead of perspective correction slows things down significantly

2) using Max3DS.load to load a file generated in 3DSMax. Collada works, too, but this is legitimate workflow as many 3D artists work in MAX and debugging a Collada export is one additional step that can be eliminated.

3) Use simple lighting – a single light source affects a a single texture in the rendering: specifically the black engine nozzles – this gives some illusion of full lighting and environment without the overhead.

4) Use the springcam class in away3D – it is necessary to set the spring constant very low and mass constant high in order to make the camera really lag behind the fighter. The goal was to see the fighter in as many angles as possible. Very useful class that sames a lot of chase cam coding. It does have some issues with “gyro tumbling” in full 3D motion.

5) Using object3D control relative to the frame of reference of the controlled Object – all this means is that we use MoveForward() to incrementally move the fighter forward, and fighter.pitch() and fighter.yaw(), rather than universal frame of reference motion controls. This saves alot of matrix math.

6) Keep collision detections to a minimum – in this case there are 10 per frame, but it can escalate quickly. Fortunately the Away3D algorithm uses threshold radius from centroid of objects, rather than bounding boxes.

There are alot of directions this can go with flash. Just knowing that 1000 polygones and a skybox is possible at this resolution opens up quite a few possibilities.

Advertisements

2 thoughts on “Flight Sim Engine using 3DSmax import and Away3D

  1. Nice work so far. I wish I could get a look at how you did a couple of things in the code. I am having trouble making my 3ds image become an object that I can play with.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s