Friday, July 31, 2009

Sunlight shading and air friction (drag)

Here are a few video clips of flight by joystick through the generated terrain. The helicopter is now also rendered with the same sunlight shader as the terrain, so you'll see how nicely it turns a black silhouette when chasing it towards the sun.







The second video clip shows flight in higher velocities to demonstrate the air resistance in the physics model. I'm currently using the drag equation for objects in high velocities. I could probably have used the Stokes' drag model which is simply a linear increase of drag over velocity, but one of the goals for this project is to achieve a high level of accuracy on the physics model.





To decide what drag model to use for the air friction vs. the fuselage (ignoring rotors for now), we must calculate the Reynolds number for air that passes around the fuselage at given speeds.

The Reynolds number is defined as:



If we assume the top speed is 15 m/s (54 km/h) we get an estimate for our Reynolds number.

ϱ = 1.204 kg/m³ (air density at 20℃)
V = 15 m/s (velocity)
L = 0.5 m (fuselage length)
μ = 1.84E−5 kg/(m·s) (air dynamic viscosity at 20℃)

Re = 490761

which indicates a turbulent flow and a good fit for the high velocity drag equation when flying at high speeds!

I'm definitely getting closer to a decently working physics model for air friction, but there are many improvements yet to implement. For instance the rotors will generate more lift as the velocity increases and wind will exert torque forces on the fuselage forcing the nose in the direction it's moving - and that's just the start! Still, I'm excited to have the basics implemented already and I can definitely see the benefits of adding more advanced physics later.

- Anj

Wednesday, July 22, 2009

Terrain and sky shaders


I eventually found time to fiddle with this project again. But once I get to sit down with it I usually find my self fiddling with stuff that ain't even remotely relevant to my thesis.

But hey, as long as I'm a happy puppy..!

In the screenshot you'll see the graphics are coming along pretty nicely since last update. I'm just getting into shaders and XNA, and have picked up some neat tricks from blogs and articles all over.

I really like how the terrain and the skydome blends neatly together with the atmospheric fog effect! The helicopter is still using its own basic shading until I find a way to easily apply the sunlight to all my game objects. Oh wait, I mean simulator objects..

Nothing new on the autopilot yet. I'm still working on a framework for using sensor feedback to estimate the state of the helicopter, but there's some distance to go yet. Besides it would be boring to do all the work now and have nothing to do when the thesis starts in September.

If my spare time continues to be awesome this summer I'll expect to get a few more updates out here soon enough.