On Sat, 3 Jul 2004 01:19:27 +0100 Lee Elliott <[EMAIL PROTECTED]> wrote: > > As I understand it, the 3d model and texture handling in FG is done via > plib, which treats the texture map path incorporated in the .ac model > file as a relative path.
Relative to what? To the directory containing the .ac file that uses
the texture? To the directory containing the .xml file that has the
<Model> tags? Relative to something else?
Because if I understand it (and I may not), that's the heart of Erik's
approach (and I'm hoping he'll jump in here if I've got it wrong).
You have different subdirectories for each livery. Each one has the
textures for that livery in it, as well as the xml file that specifies
the 3D model, but NOT the 3D model itself (which is, say, in the parent
directory). The .xml file gets read; the <Model><path> tags provide a
relative pathname from where the .xml is located upstairs to the .ac
file; the .ac file calls textures which are loaded from the directory
the thread is currently in -- namely, the one with the .xml file.
This presumes that when the .xml file sends plib off to get the .ac
file in a different directory by specifying a relative path, the place
plib looks for subsequent file opens won't be in that different
directory. That seems sensible. Do I have it right?
If so, then the trick is having something in the (aircraftname)-set.xml
file that makes the <model><path> be conditional based on the livery.
For example, for the 737, which currently has in its 737-set.xml
<model>
<path>Aircraft/737/Models/boeing733.xml</path>
</model>
and Aircraft/737/Models/boeing733.xml currently has
<path>B737-300.ac</path>
<offsets>
stuff
</offsets>
<animation>
etc.
you could instead have something like 737-set.xml containing
<model>
<path>Aircraft/737/Models/United/boeing733.xml</path>
<condition>
<equals>
<property>.../livery-name</property>
<value>united</value>
</equals>
</conditon>
</model>
<model>
<path>Aircraft/737/Models/Southwest/boeing733.xml</path>
<condition>
<equals>
<property>.../livery-name</property>
<value>southwest</value>
</equals>
</conditon>
</model>
Then, in Models/United/boeing733.xml and Models/Southwest/boeing733.xml,
you have exactly the same content:
<path>../B737-300.ac</path>
<offsets>
stuff
</offsets>
<animation>
etc.
so they both use the same 3D model; but the textures are drawn out of
the directory that boeing733.xml is being read from, which means
putting different textures in Models/United and Models/Southwest would
do the trick.
(in fact, since they have exactly the same content, each of the
different boeing733.xml files could just read their content from
elsewhere through an include)
Does this make sense? Am I understanding you, Erik?
-c
--
Chris Metzler [EMAIL PROTECTED]
(remove "snip-me." to email)
"As a child I understood how to give; I have forgotten this grace since I
have become civilized." - Chief Luther Standing Bear
pgp1FBBM6muCM.pgp
Description: PGP signature
_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
