i've been learning: to incorporate a separate pilot model...

Today's task was to extract the pilot model from the main aircraft model for re-usability's sake. It was actually quite simple. Since I use Wings3d for modelling I opened Wings, selected the pilot parts and saved them to its own model. Then I deleted the pilot from the aircraft model. I then exported both the pilot and modified aircraft models to *.obj format and used my own conversion script to convert the files to *.ac format.

I think I'll call the pilot 'Calvin' for two reasons. One, the original pilot of the Vin Fiz was Calbreath 'Cal' Rodgers. Calvin's outfit is based on a photo of Cal dressed in a fisherman's sweater and striped dress pants. I believe that's what he was wearing when he started his cross country flight in 1911. Secondly, I'm a fan of the comic 'Calvin and Hobbes'. 

World, meet Calvin!

On to Flightgear!

1. Keep an organized directory structure

The first step was to modify the aircraft directory structure to keep things organized. So I created an 'early_pilot' directory and copied the pilot 'ac' file and associated graphic textures there.

2. Create a pilot 'xml' file

The pilot 'xml' file refers to the model 'ac' file and is like any other 'xml' file.

<PropertyList>
  <path>early_pilot.ac</path>
  <animation>...

This file is also contains the pilot animations. I've animated Calvin's head to move with the ailerons, rudder and elevator. His hands rotate a little bit with the ailerons as do the control sticks. The hands and sticks don't really move together but it's close enough for this first attempt.

 3. Edit the aircraft 'xml' file

Let the aircraft 'xml' (WrightEX-1911.xml in this case) know where the pilot is and where it should be located. Note that the <path> refers to the pilot 'xml' file, not the 'ac' file itself:

<!-- Pilot Model-->
  <model>
    <name>Pilot</name>
    <path>Aircraft/WrightEX-1911/Models/early_pilot/early_pilot.xml</path>
    <offsets>
      <x-m> -0.165 </x-m>
      <y-m> -0.270 </y-m>
      <z-m> -0.639 </z-m>
    </offsets>
  </model>

That's really all there was to it!



Calvin and I then flew the Vin Fiz from Bar Harbor, ME, to Ellsworth and then to Bangor. It's been a good day.



Comments

Popular posts from this blog

what's old is new again...