Saturday, March 8

Taking Flight


Here is a screenshot from my latest pet-project, a helicopter flight sim. It's written using Python (of course) and Pyglet . This is my first foray into 3D graphics, and I'm having a lot of fun learning OpenGL and training my brain to think in 4x4 transformation matrices ;^)

Writing a semi-realistic simulation (I don't think I can do better having never flown a real helicopter) is a bit humbling and gives me a a lot respect for aerospace engineers who have to make real heavier-than-air objects fly in a controllable fashion. The latter part is the crucial detail and I have spent many an hour trying to figure out why my poor virtual bird (note real pilots don't call them "choppers") would starting flipping out of control seemingly of its own volition.

The terrain is randomly generated by a little python script I wrote last weekend. If you want to play with that part, you can get it from a page I made for it in the Pyglet google group. It's kinda fun and can generate a variety of different terrain types.

Both the terrain script and the prototype heli.py script shown above are available via svn from my code repository. Note the word prototype above. The script is very basic, slightly better than a proof-of-concept and not well factored yet. That said I find it fun to fly around. You'll need Python, Pyglet (1.1) and PyODE to run it.

0 Comments:

Post a Comment

<< Home