How to animate a model – ArmA: Armed Assault Talk
(animations / translations) |
|||
Line 6: | Line 6: | ||
for the bones, it is possible to link several bones almost like in the article. | for the bones, it is possible to link several bones almost like in the article. | ||
<pre> | |||
skeletonBones[]= | skeletonBones[]= | ||
{ | { | ||
Line 12: | Line 13: | ||
"bone3","bone2" | "bone3","bone2" | ||
}; | }; | ||
</pre> | |||
here, we have bone3 connected to bone2, which is connected to bone1. if bone1 move, bone2 and bone3 will move with him. | here, we have bone3 connected to bone2, which is connected to bone1. if bone1 move, bone2 and bone3 will move with him. | ||
if bone2 move, only bone3 will move with it, bone1 will remain unchanged, etc... | if bone2 move, only bone3 will move with it, bone1 will remain unchanged, etc... | ||
Line 28: | Line 29: | ||
if the distance between my two points is different, the bone movement will scale accordingly - if distance between the two points of the axis is 0.5m, the bone will only translate by 2.5 meters. | if the distance between my two points is different, the bone movement will scale accordingly - if distance between the two points of the axis is 0.5m, the bone will only translate by 2.5 meters. | ||
<pre> | |||
class translatedobject | class translatedobject | ||
{ | { | ||
Line 41: | Line 43: | ||
offset1="5"; | offset1="5"; | ||
}; | }; | ||
</pre> | |||
another important point to know, is that the types TranslationX, TranslationY, and TranslationZ, if used without axis, do not have a meter based unit. | another important point to know, is that the types TranslationX, TranslationY, and TranslationZ, if used without axis, do not have a meter based unit. | ||
so it may be better to use your own axis for doing accurate translations. Also, without an axis, the translation will correctly translate along the X, Z or Y axis, but the game engine seems to act weird for the direction to follow along this axis (several times, the object moved only in one direction, whatever the offset1 value was negative or not.) | so it may be better to use your own axis for doing accurate translations. Also, without an axis, the translation will correctly translate along the X, Z or Y axis, but the game engine seems to act weird for the direction to follow along this axis (several times, the object moved only in one direction, whatever the offset1 value was negative or not.) |
Revision as of 03:13, 16 March 2007
I decided to make move this article from my sandbox to an own article on the wiki since I don't have enough time to finish an article of this size. Feel free to add things to the article or change it. Cheers, --TeRp 15:58, 1 March 2007 (CET)TeRp.
animations / translations
after my own tests on the animations, i have discovered the following things: for the bones, it is possible to link several bones almost like in the article.
skeletonBones[]= { "bone1","" "bone2","bone1", "bone3","bone2" };
here, we have bone3 connected to bone2, which is connected to bone1. if bone1 move, bone2 and bone3 will move with him. if bone2 move, only bone3 will move with it, bone1 will remain unchanged, etc... i haven't tested the maximum limit of bones you can link like that, but 3 bones linked like that works perfectly.
the translations.
for the translations, you need offset0 and offset1 in place of angle0 and angle1.
one thing important to know about translation axis(done several tests about it)
the distance between the two points of your axis will become the "unit" of the offset. in the following example, i have an offset1="5", which means the bone will translate by 5 units. if the distance between the two points of my axis is 1 meter (assuming meters are the base unit in oxygen), the bone will move by 5 meters. if the distance between my two points is different, the bone movement will scale accordingly - if distance between the two points of the axis is 0.5m, the bone will only translate by 2.5 meters.
class translatedobject { type="translation"; source="animtranslate"; selection="translatedbone"; axis="translateaxis"; memory=1; sourceAddress="clamp"; minValue="0"; maxValue="1"; offset0="0"; offset1="5"; };
another important point to know, is that the types TranslationX, TranslationY, and TranslationZ, if used without axis, do not have a meter based unit. so it may be better to use your own axis for doing accurate translations. Also, without an axis, the translation will correctly translate along the X, Z or Y axis, but the game engine seems to act weird for the direction to follow along this axis (several times, the object moved only in one direction, whatever the offset1 value was negative or not.)