Howto:Animate models: Difference between revisions

Jump to navigation Jump to search
→‎Touch: added link to the full page
m (Added behaviour when Translate Animation is used without any Property)
(→‎Touch: added link to the full page)
(10 intermediate revisions by 5 users not shown)
Line 15: Line 15:
{{Main article|AC files: Understanding and changing .ac code#Identifying an object}}
{{Main article|AC files: Understanding and changing .ac code#Identifying an object}}


When referring to an .ac file in your xml animation, it is important that the <code><object name></code> exactly matches the object named in the .ac file (this includes cases!).  
When referring to an .ac file in your xml animation, it is important that the <code><object-name></code> exactly matches the object named in the .ac file (this includes cases!).  


'''Note for SketchUp users:''' The spatial reference X/Y/Z used in animation to locate an object or a point are different from the ones in AC3D ie X values are the same in both but Y in animation must be matched to AC3D's -Z (Z value but opposite sign) and Z value in animation must be matched to AC3D's Y value.  
'''Note for SketchUp users:''' The spatial reference X/Y/Z used in animation to locate an object or a point are different from the ones in AC3D ie X values are the same in both but Y in animation must be matched to AC3D's -Z (Z value but opposite sign) and Z value in animation must be matched to AC3D's Y value.  
Line 57: Line 57:
</source>
</source>


Note the omission of the leading slash '/' when reffering to the property. This assures that when the model is used for AI or multiplayer traffic the animations will follow that of the AI controller instead of that of the user.
Note the omission of the leading slash '/' when referring to the property. This assures that when the model is used for AI or multiplayer traffic the animations will follow that of the AI controller instead of that of the user.


=== Axis ===
=== Axis ===
Line 103: Line 103:


Added in V2017.2 is support to allow a geometry object (a line segment with two vertices) that is used to define both the centre and the axis for an animation. This will work with rotate, translate and the knob animations.
Added in V2017.2 is support to allow a geometry object (a line segment with two vertices) that is used to define both the centre and the axis for an animation. This will work with rotate, translate and the knob animations.
The axis line should be balanced, i.e. it should protrude equal amounts.


The syntax for this is  
The syntax for this is  
Line 596: Line 598:
The first figure (<ind> refers to the value of the property associated with the object and the second figure (in <dep>) refers to the amount that the object moves in metres. For example, in this case, the object moves 18cm when the value reads 0.66 and 27cm when the value is 1.
The first figure (<ind> refers to the value of the property associated with the object and the second figure (in <dep>) refers to the amount that the object moves in metres. For example, in this case, the object moves 18cm when the value reads 0.66 and 27cm when the value is 1.


The animation can also be used WTIHOUT property. In this case the object is placed X (Value of Offset) meters away from its original position, along the virtual axis formed by said original position and the point with coordinates x/y/z defined in the <axis> tag.  
'''IF used WTIHOUT property''' : The object is placed at some (Value of Offset) meters away from its original position, along the virtual axis formed by said original position and the point with coordinates x/y/z defined in the <axis> tag.
Mathematically, assuming the Object to translate is (in the model space) placed at point A (x1, y1, z1) and you want to relocate it to point B (x2, y2, z2) then x2,y2,z2 are the values in the <axis> tag of the Translate animation and <offset> can be computed as SQRT((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)




Line 620: Line 623:
'''Optional:'''
'''Optional:'''
* '''property-base:''' when using prop(erties), you might want to set a property-base. All props will be relative to this path.
* '''property-base:''' when using prop(erties), you might want to set a property-base. All props will be relative to this path.
* '''global (depreciated):''' by setting this to <tt>true</tt>, all objects using the same material as the defined object(s) (via <tt><object-name></tt>) will be affected by the animation. 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. <span style="color:red; text-decoration: underline;">This tag is no longer supported</span>
* '''global (deprecated):''' by setting this to <tt>true</tt>, all objects using the same material as the defined object(s) (via <tt><object-name></tt>) will be affected by the animation. 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. <span style="color:red; text-decoration: underline;">This tag is no longer supported</span>


'''Notes:'''
'''Notes:'''
Line 822: Line 825:
=== Pick ===
=== Pick ===
{{Main article|Howto: Make a clickable panel#Pick}}
{{Main article|Howto: Make a clickable panel#Pick}}
=== Touch ===
The touch animation provides the normalized coordinates of a touch (or click) event on a 2d surface. The coordinates are passed in the argument and can be accessed using cmdarg() in Nasal.
See more info here: [[Touch Animation]]
    <animation>
        <type>touch</type>
        <visible>true</visible>
        <object-name>VSDImage</object-name>
        <action>
            <touch>0</touch>
            <repeatable>false</repeatable>
            <binding>
                <command>nasal</command>
                <script>print("touch input (",cmdarg().getNode("x").getValue(),",",cmdarg().getNode("y").getValue())</script>
            </binding>
        </action>
    </animation>


== Shadow Handling ==
== Shadow Handling ==
Line 834: Line 857:
}}
}}


== Related content ==
=== Wiki articles ===
* [[MP Fallback models]]
* [[Howto:Animate gear scissors]]
* [[Howto:Animate helicopters]]
* [[Howto:Creating 3D instruments]]
=== Forum topics ===
* {{forum link|t=36545|title=speedo Drum settings}} - Animating a mechanical multi-digit drum counter


[[Category:Aircraft enhancement|Animate models]]
[[Category:Aircraft enhancement|Animate models]]
579

edits

Navigation menu