[This entry has been imported from my old blog, therefore, links and images might now show correctly. Sorry about that]
Live from Orange County Airport Test Facilities, here’s an update on the Flight Simulator Project.
There are three things I’d like to write about tonight: Aircraft shadows, flight parameters, and a thought about optimizations.
![[Shadows] Shadow test in void world](/blogs//images/labtech_epitech_net/matt/52/t_Screenshot-758.jpg)
First of all, Shadows. I’ve received several comments about the shadows in the sim. I know there were crappy. I didn’t spend a lot of time on this feature since I only needed it to get some kind of visual reference of the aircraft distance from the ground when landing. But time had come to make a little research on the subject.
Considering the fact that I had just completed my render to texture marathon, I figured I would use this approach to render shadows below the aircraft.
The process was simple, render the aircraft from above in a texture. Post process this rendering in a shader that would do some stuff to make the texture usable on a blended quad.
I tweaked and tweaked and it worked. I had my rendered shadow. One thing though, I completely forgot about the fps counter that dropped down 20 fps :-/ Well, since there was no way I would go back to the old shadow system, I decided to do this the quick and crappy way: a blended texture created off-line applied on a quad. I know, shame on me, or not, I was surprised with the results! So I’m going to stick with this technique for now :-)
Flight Parameters:
Up until a couple weeks earlier, there was no flight behavior difference between the Cessna 210 and the Piper PA-28 in the simulator. Their flight parameters were sort of hard coded. I had externalized a bunch of values already, like engine position, mass, and so on, but none of the actual flight parameters were modifiable.
I then decided to externalize more parameters, like engine power, controls inertia, lift & drag parameters … With these out of the .cs files, it’s now possible to tweak aircraft physics so that you have a more powerful aircraft or an aircraft that will stall at whatever speed you choose.
To test this, I couldn’t possibly think of doing anything besides creating an aerobatic airplane ;-)
Enters the PA-28 Aerobatic with special livery!
It’s an extended version of my PA-28 but with extra sensitive controls and a nitrogen powered engine ;-)
The flight feeling with this aircraft is different from the default PA-28, but you’re going to have to trust me on that one ;-) (When will I release a version anyways ?)
![[Shadows] Crazy Aircraft](/blogs//images/labtech_epitech_net/matt/52/t_Screenshot-779.jpg)
Touch down - Crazy aircraft
![[Shadows] Seconds before touch down](/blogs//images/labtech_epitech_net/matt/52/t_Screenshot-781.jpg)
Final with flaps - Steep climb - Very short final !
![[Shadows] Take off](/blogs//images/labtech_epitech_net/matt/52/t_Screenshot-774.jpg)
Special livery - Take off
The lift and drag calculations have also been changed from a linear equation to pairs of angles/values within the aircraft configuration file. It’s now possible to have a precise control on when the aircraft is going to stall.
Optimizations:
I also worked on some optimizations, but though they should have, none of them changed *anything*, so I’m simply not going to talk about them … that’ll show them! :-P
That’s it for today.
Happy Landings !