This is now in cvs. A "material" animation can manipulate all material properties of a an ssgSimpleState. These are:
diffuse-{red,green,blue,factor,offset} \ ambient-{red,green,blue,factor,offset} | see "man glMaterial" specular-{red,green,blue,factor,offset} | emission-{red,green,blue,factor,offset} / transparency = 1.0 - alpha threshold = alpha-clamp (see "man glAlphaFunc"; func is always GL_GREATER) shininess texture string, relative to "texture-path" Numbers are clamped to 0.0-1.0, except "shininess", which is clamped to 0-128. Example: <animation> <object-name>fuselage</object-name> <diffuse-red>1.0</diffuse-red> <diffuse-green>0.8</diffuse-green> <diffuse-blue>0.0</diffuse-blue> </animation> This sets the fuselage color to a warm yellow. If one sets the "global" property to "true", then not only the fuselage color is changed, but the fuselage *material*. That is: all objects using this material will be yellow. This is preferred to listing several objects in <object-name> tags. It's not only faster, but also doesn't break animations by forcing objects together. Fixed values are mainly useful for cases where two *-set.xml files use the same 3D model. One can then make the aircraft shiny blue, and the other dull. This couldn't be done by changing the textures only! By appending "-prop", each of the properties can also read its value from another property. This is for live-update: <animation> <object-name>panel</object-name> <global type="bool">true</global> <diffuse-red-prop>/sim/model/foo/diffuse-red</diffuse-red-prop> <diffuse-green-prop>/sim/model/foo/diffuse-green</diffuse-green-prop> <diffuse-blue-prop>/sim/model/foo/diffuse-blue</diffuse-blue-prop> </animation> It's a good idea to set these referred properties in the *-set.xml file: <sim> <model> <foo> <diffuse-red>1.0</diffuse-red> <diffuse-green>0.8</diffuse-green> <diffuse-blue>0.0</diffuse-blue> </foo> </model> </sim> It's not necessary to name these properties with the material animation's terminology ("diffuse-red" etc.), but if you do so, you can open the material dialog from another Nasal file or a Nasal key binding: material.openDialog("/sim/model/foo/") and get a dialog like these: http://members.aon.at/mfranz/material2.jpg [44 kB] In this screenshot I used the material dialog for three materials. It's three times the same dialog, but it only displays the elements of the respective property node. (See $FG_ROOT/Aircraft/bo105/ for an example). The "emblem" window, for example, has only a "texture" property. This texture can be changed at runtime! It's no longer necessary, for an alternative livery to duplicate *all* textures and to set the path in <texture-path>. Instead, one can select textures for particular objects via property. This can save a lot of diskspace. Also, it's no longer necessary to put several logos into one huge texture file only to be able to change a logo at runtime (via "textranslate" animation). Instead, the whole texture can be replaced, and plib frees the memory for no longer used textures (or at least is supposed to). Of course, this shouldn't be used for single digits of a number display. The updated bo105 uses this "texture" feature for the emblems/insignia. (Note the difference of the emblem when you start from KSFO, from LTAG, and from LLBG!) With the "Shift-C" key you get a material dialog for the fuselage. With the "c" key you can switch the whole helicopter to a different variant, with different colors/emblems. The default machine is still yellow, but there are others ... http://members.aon.at/mfranz/hot.jpg [22 kB] (no animated submodels for these toys, yet. ;-) Now, this does all sound like a lot of work for plib/sg, and as if a material animation were expensive in terms of performance. It isn't. m. PS: thanks go to Jim for his "material-emission" animation, which I hacked for this, and which is now removed. _______________________________________________ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d