Howto:Animate models: Difference between revisions

m
m (added Scale animation)
(11 intermediate revisions by 5 users not shown)
Line 5: Line 5:
This document provides basic information for all kind of animations. When animating your model, it is very helpful to find an aircraft with parts similar to yours and use it as an example. Cut and paste the code into your wrapper file and then edit to suit.
This document provides basic information for all kind of animations. When animating your model, it is very helpful to find an aircraft with parts similar to yours and use it as an example. Cut and paste the code into your wrapper file and then edit to suit.


== A note about animation order ==
== Notes ==
Animations are executed by FlightGear in the order that they are read in the model's .xml file. Therefore, it is very important to pay attention to the order, especially when multiple animations are applied to the same object(s).
=== File name of main model and animation XML file ===
{{main article|Aircraft-set.xml#Not used for loading multiplayer aircraft}}
The file name of the main model and animation XML file, or the .ac file if there is no XML file, (in essence the property <code>/sim/model/path</code>) will be the name of the aircraft that is transmitted when using [[multiplayer]] and will also be used for loading multiplayer aircraft.
 
There is also a mechanism to substitute a full aircraft model with a simpler AI aircraft model if one is available at the same file path (including for example <code>Models/Boeing-797-800.xml</code>), but in <code>[[$FG_ROOT]]/'''AI'''/Aircraft/</code> instead of <code>$FG_ROOT/Aircraft/</code>.


== A note about .ac files ==
=== .ac files ===
{{Main article|AC files: Understanding and changing .ac code#Identifying an object}}
{{Main article|AC files: Understanding and changing .ac code#Identifying an object}}


Line 15: Line 19:
'''Note for SketchUp users:''' when exporting to AC3D in Sketchup, the .ac file will name the objects in your model to "blah" by default. You need to amend the relevant object names in your .ac file using text edit, so that the xml will work.
'''Note for SketchUp users:''' when exporting to AC3D in Sketchup, the .ac file will name the objects in your model to "blah" by default. You need to amend the relevant object names in your .ac file using text edit, so that the xml will work.


== Summary of animations and tags ==
=== Animation order ===
{{WIP|Will be adding this over the coming days. /[[User:Johan G|Johan G]]}}
Animations are executed by FlightGear in the order that they are read in the model's .xml file. Therefore, it is very important to pay attention to the order, especially when multiple animations are applied to the same object(s).
{| class="wikitable"
! colspan="2" | Animation
! colspan="13" | Tags
! rowspan="2" | Comments
|-
! &lt;type&gt; !! Purpose
! &lt;axis&gt; !! &lt;center&gt; !! &lt;condition&gt; !! &lt;expression&gt; !! &lt;factor&gt; !! &lt;interpolation&gt; !! &lt;power&gt; !! &lt;min&gt; !! &lt;max&gt; !! &lt;name&gt; !! &lt;offset&gt; !! &lt;object-name&gt; !! &lt;property&gt; <!-- !! &lt;&gt; -->
|-
|
|}


== Tags used in most animations ==
== Tags used in most animations ==
Line 349: Line 343:


=== Noshadow ===
=== Noshadow ===
This animation is used to make sure an object will cast no shadow.
<source>
<source>
  <animation>
  <animation>
Line 357: Line 353:


=== Range ===
=== Range ===
: ''See also [[Modeling - Getting Started#Level of Detail (LOD)]].''
To prevent objects -like instruments- being drawn when the aircraft is actually too far away for them to be seen anyway, a range animation is used.  
To prevent objects -like instruments- being drawn when the aircraft is actually too far away for them to be seen anyway, a range animation is used.  


Line 410: Line 408:
   <object-name>Object</object-name>
   <object-name>Object</object-name>
   <type>rotate</type>
   <type>rotate</type>
   <property>suface-positions/left-aileron-pos-norm</property>
   <property>surface-positions/left-aileron-pos-norm</property>
   <factor>25</factor>
   <factor>25</factor>
   <offset-deg>25</offset-deg>
   <offset-deg>25</offset-deg>
Line 460: Line 458:


* x.offset: the scale factor.
* x.offset: the scale factor.
* '''[[Howto:Animate_models#Expressions|expression]]:''' is optional. For more details see [[Expressions|Expressions]]
* Add [[#Center|&lt;center&gt;]] coordinates, to scale the object around that point.
* '''You can optionally use an [[Howto:Animate_models#Expressions|expression]] in the <factor> or <offset> inputs.''' For more details see [[Expressions|Expressions]]


=== Select ===
=== Select ===
Line 766: Line 765:
</source>
</source>


* '''enable-hot:''' can be either true or false. Remember that objects are automatically solid, so it should not be nesecarily to set this at all when wanting solidness.
* '''enable-hot:''' can be either true or false. Remember that objects are automatically solid, so it should not be necessary to set this at all when wanting solidness.


=== Interactions ===
=== Interactions ===
Line 787: Line 786:
=== Pick ===
=== Pick ===
{{Main article|Howto: Make a clickable panel#Pick}}
{{Main article|Howto: Make a clickable panel#Pick}}
== Shadow Handling ==
There exist several possibilites for handling of shadows. <br />
See '''[[ALS_technical_notes|ALS Technical Notes]]''' and more specific '''[[ALS_technical_notes#ALS_fuselage_shadow_effect|Fuselage Shadow Effect with ALS]]''' for a relatively simple shadow handling.<br />
See '''[[Project Rembrandt]]''' which - amongst other functionality - implements a very realistic shadow mapping.


== References ==
== References ==
546

edits