<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Samples, Starter Kits, Tutorials</title><link>http://forums.xna.com/forums/59.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Attaching a weapon to a skinned character hand (3D) - How to...</title><link>http://forums.xna.com/forums/thread/196168.aspx</link><pubDate>Fri, 03 Jul 2009 22:12:47 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:196168</guid><dc:creator>creasso</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/196168.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=59&amp;PostID=196168</wfw:commentRss><description>@Billy Boy: Well, a skinned model IS a model animated by bones, so if you have a character moving arms and etc, your content processor should be reading the bones, anyway, your skeleton should contain objects that are doing the &amp;quot;bone&amp;quot; role, you just need find the type and their names. My code just gets the 0,0,0 placement of the item and moves it to a hand bone position.&lt;br /&gt;
&lt;br /&gt;
@tadmiral: Usually I do my models with a size reference so is difficult find a situation where I need resize the models at runtime (TIP: on your modelling tool try keep scale while modelling anc check if it fits within your character). In XNA you&amp;#39;ll find a function that scale objects &amp;quot;Matrix.CreateScale(x,y,z)&amp;quot;. Unfortuntelly when you multiply the AbsoluteTransform by the result the object will leave the character hand, to save time, I advice you to scale the model on the 3D Tool.</description></item><item><title>Re: Attaching a weapon to a skinned character hand (3D) - How to...</title><link>http://forums.xna.com/forums/thread/194496.aspx</link><pubDate>Mon, 29 Jun 2009 11:46:14 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:194496</guid><dc:creator>tadmiral</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/194496.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=59&amp;PostID=194496</wfw:commentRss><description>This method works but how do you scale your model??</description></item><item><title>Re: Attaching a weapon to a skinned character hand (3D) - How to...</title><link>http://forums.xna.com/forums/thread/191173.aspx</link><pubDate>Thu, 18 Jun 2009 18:24:49 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:191173</guid><dc:creator>Billy Boy</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/191173.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=59&amp;PostID=191173</wfw:commentRss><description>I am trying to impliment this in my project with no luck. My skinned Data Processor does not have a bone class, or from what I can see an absoluteTransforms matrix. I created a new Matrix[] called boneTransforms and set it to contain the number of bones in my weaponModel (3 i think). I then have this line of code:&lt;br /&gt;
&lt;br /&gt;
weaponModel.CopyAbsoluteBoneTransformsTo(boneTransforms);&lt;br /&gt;
OriginalPos = boneTransforms.ElementAt(1);&lt;br /&gt;
&lt;br /&gt;
I dont know if this is doing the same thing as your code, but it doesnt seem to work. Do you know what the absoluteTransforms in your example contain, or have any idea why this doesnt work?</description></item><item><title>Re: Attaching a weapon to a skinned character hand (3D) - How to...</title><link>http://forums.xna.com/forums/thread/179574.aspx</link><pubDate>Mon, 18 May 2009 08:29:27 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:179574</guid><dc:creator>digitalerr0rDCC</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/179574.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=59&amp;PostID=179574</wfw:commentRss><description>Thank you for your contribution, and I know there are many who want to have this in their games :)</description></item><item><title>Attaching a weapon to a skinned character hand (3D) - How to...</title><link>http://forums.xna.com/forums/thread/178966.aspx</link><pubDate>Sat, 16 May 2009 21:38:22 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:178966</guid><dc:creator>creasso</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/178966.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=59&amp;PostID=178966</wfw:commentRss><description>Hi.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;m working on a game like everyone here, I can&amp;#39;t deny that I learnt a lot from here, so I felt that is my time to try give a small contribution to pay back all that I learnt, hope that this helps someone. I warn that there must be some other ways, this one is just a solution that I got hacking some matrices and experiencing, so if you don&amp;#39;t have another solution until now you can give this one a try ^^.&lt;br /&gt;
&lt;br /&gt;
Well, here we go:&lt;br /&gt;
&lt;br /&gt;
What you&amp;#39;ll need:&lt;br /&gt;
- Full access to your skinning processor code (You&amp;#39;ll need do some changes if you can&amp;#39;t access some bone properties)&lt;br /&gt;
- Your skinned character already working.&lt;br /&gt;
- A model from your weapon (don&amp;#39;t need be a skinned one).&lt;br /&gt;
- A bit of patience while setting up your weapon pivot on the 3D software.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;1 - The absolute transform matrix&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
You need full access to the Absolute Transform from your hand bone, why? This Matrix sums all the accumulated transforms that our character&amp;#39;s hand suffer starting from the root bone, this means that if we replace the original world matrix from our weapon model by this one on the draw call, the weapon will be rendered already on the character&amp;#39;s hand. If you are using some of the samples found on the internet to skinned processing, you&amp;#39;ll probably find the declaration of your bone class in the &amp;quot;skinning info&amp;quot; namespace.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;public &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;class&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Bone&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size:13px;"&gt;{&lt;br /&gt;
    &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;int&lt;/span&gt;&lt;span style="font-size:13px;"&gt; id; &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//whatever&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;String&lt;/span&gt;&lt;span style="font-size:13px;"&gt; name; &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//whatever&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Matrix&lt;/span&gt;&lt;span style="font-size:13px;"&gt; transform; &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//whatever &lt;br /&gt;
&lt;br /&gt;
    &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Matrix&lt;/span&gt;&lt;span style="font-size:13px;"&gt; absoluteTransform; &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//YOU REALLY NEED ACCESS TO THIS!
&lt;p&gt; &lt;/p&gt;
&lt;/span&gt;
&lt;p&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Matrix&lt;/span&gt;&lt;span style="font-size:13px;"&gt; inverseTransform; &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//whatever&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;List&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;AnimationClip&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;gt; animationClips; &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//whatever&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;int&lt;/span&gt;&lt;span style="font-size:13px;"&gt; parentID; &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//whatever&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;List&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;int&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;gt; childrenIDs; &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//whatever&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    &lt;br /&gt;
    public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; Bone()&lt;br /&gt;
    {&lt;br /&gt;
        childrenIDs = &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;new&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;List&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;int&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;gt;();&lt;br /&gt;
        animationClips = &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;new&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;List&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;AnimationClip&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;gt;();&lt;br /&gt;
    }&lt;br /&gt;
} &lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;/code&gt;So, find your bone class and make sure that the Absolute Transform is freely accessible, like a&lt;strong&gt; public parameter&lt;/strong&gt; or a &lt;strong&gt;property&lt;/strong&gt;.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;2 - Add a getHandMatrix( ) method to your Animation Processor&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
To get the skinned transformation to apply on our character&amp;#39;s hand bone, we&amp;#39;ll first update the Animation Controller (we do this when we call &lt;em&gt;SkinModel.Update(GameTime)&lt;/em&gt;) this matrix will point all the transformations to the current frame, if you know exactly which skinnedtransformation matrix you&amp;#39;ll need just need point it. There are reasons to the Animation Controller class keep all the matrices like protected, so imo the best way to get just the matrix without break the class security level is add a new method.&lt;br /&gt;
&lt;code&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt; &lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;public class&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;AnimationProcessor&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size:13px;"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    protected&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;List&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;TrilhaAnimao&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&amp;gt; tracks;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    protected&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;MalhaAnimao&lt;/span&gt;&lt;span style="font-size:13px;"&gt; model;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    protected&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Matrix&lt;/span&gt;&lt;span style="font-size:13px;"&gt;[] combinedFrameTransformations;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    protected&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Matrix&lt;/span&gt;&lt;span style="font-size:13px;"&gt;[] worldTrandformations;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    protected&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Matrix&lt;/span&gt;&lt;span style="font-size:13px;"&gt;[] skinTransformations;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    int&lt;/span&gt;&lt;span style="font-size:13px;"&gt; boneCount;&lt;br /&gt;
&lt;br /&gt;
    &lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;//Add this method&lt;br /&gt;
    &lt;/span&gt;&lt;strong&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Matrix&lt;/span&gt;&lt;span style="font-size:13px;"&gt; getHandMatrix(&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;int&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:13px;"&gt; ind)&lt;br /&gt;
    {&lt;br /&gt;
        &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;return&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size:13px;"&gt;&lt;strong&gt; skinTransformations[ind]; &lt;br /&gt;
    }&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
...&lt;/span&gt; &lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;This way you can call this method inside all weapon.update( )s to move the weapon - &lt;strong&gt;you can probably access the animation controller from your character, because it is commonly a property in most Skinned Samples&lt;/strong&gt; - you just need point the index of your bone hand and the returned matrix will be exactly the transformations that must be applied on the animation frame. We are done with the skinnedmodel library and processors, so, just recompile your updated dll and reload on your project references.This way you can call this method inside all weapon.update( )s to move the weapon, you just need point the index of your bone hand and the returned matrix will be exactly the transformations that must be applied on the animation frame. We are done with the skinnedmodel library and processors, so, just recompile your updated dll and reload on your project references. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;3 - Preparing your weapon/equipment class&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;Now, inside your weapon class, you must do some changes to use the information, first you&amp;#39;ll add 2 new matrices, one to keep the hand original position, and another to be a variable that will be updated:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&lt;p&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;public class&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;GraphWeapon&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size:13px;"&gt;{&lt;br /&gt;
    &lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;Model&lt;/span&gt;&lt;span style="font-size:13px;"&gt; WeapModel;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;    String&lt;/span&gt;&lt;span style="font-size:13px;"&gt; ResourceName;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#008000;font-size:13px;"&gt;    // The trick is use the same animation controller than your character, so add a property&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#2b91af;font-size:13px;"&gt;    AnimationController&lt;/span&gt;&lt;span style="font-size:13px;"&gt; AnimControl;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;    public&lt;/span&gt;&lt;span style="font-size:13px;"&gt; &lt;span style="color:#2b91af;font-size:13px;"&gt;AnimationController&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:13px;"&gt; Animator&lt;br /&gt;
    {&lt;br /&gt;
        &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;get&lt;/span&gt;&lt;span style="font-size:13px;"&gt; { &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;return&lt;/span&gt;&lt;span style="font-size:13px;"&gt; AnimControl; }&lt;br /&gt;
&lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;        set&lt;/span&gt;&lt;span style="font-size:13px;"&gt; { AnimControl = &lt;/span&gt;&lt;span style="color:#0000ff;font-size:13px;"&gt;value&lt;/span&gt;&lt;span style="font-size:13px;"&gt;; }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;span style="font-size:13px;"&gt;&lt;strong&gt;&lt;span style="color:#2b91af;"&gt;Matrix&lt;/span&gt; &lt;span style="font-size:13px;"&gt;OriginalPos&lt;/span&gt;;&lt;/strong&gt; &lt;span style="color:#008000;font-size:13px;"&gt;// The first weapon state&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
    &lt;strong&gt;&lt;span style="font-size:13px;"&gt;&lt;span style="color:#2b91af;"&gt;Matrix&lt;/span&gt; AnimatedPos&lt;/span&gt;;&lt;/strong&gt; &lt;span style="color:#008000;font-size:13px;"&gt;// The animated weapon state&lt;br /&gt;
    &lt;/span&gt; &lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;/code&gt;The next step is initialize the matrices, first the OriginalPos one, but, unfortunatelly we can&amp;#39;t do this on the constructor because it needs information about a pre-initialized character, so the best place to get it is on inside the Load( ) method, and after your character be loaded by your application, the character or the own application could provide the needed info: &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size:13px;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#000066;"&gt;    public &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;void&lt;/span&gt;&lt;span style="color:#000066;"&gt; Load(&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;AnimationController&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#000066;"&gt; Controller_IN, ...)&lt;br /&gt;
    {&lt;br /&gt;
        AnimControl = &lt;span style="font-family:courier new;color:#000066;font-size:13px;"&gt;Controller_IN&lt;/span&gt;; &lt;span style="font-family:courier new;color:#008000;font-size:13px;"&gt;// links the character controller to the weapon one&lt;/span&gt;&lt;br /&gt;
        &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Bone&lt;/span&gt;&lt;span style="color:#000066;"&gt; Hand = &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt;&lt;span style="color:#000066;"&gt; &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Bone&lt;/span&gt;&lt;span style="color:#000066;"&gt;(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&lt;span style="font-family:courier new;color:#008000;"&gt;// temporary bone&lt;br /&gt;
        &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#000066;"&gt;Hand = &lt;span style="font-family:courier new;color:#000066;font-size:13px;"&gt;Controller_IN&lt;/span&gt;.SkinnedModel.Skeleton.skeleton[X];&lt;br /&gt;
        OriginalPos = Hand.absoluteTransform; &lt;/span&gt;&lt;span style="color:#008000;"&gt;// fills the matrix&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family:courier new;color:#000066;"&gt;        ...&lt;br /&gt;
    }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The other matrix, will get updated info doing a call inside the weapon&amp;#39;s update( ) method:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family:courier new;font-size:13px;"&gt;&lt;span style="color:#000066;"&gt;    public &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;void&lt;/span&gt;&lt;span style="color:#000066;"&gt; Update( &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;color:#000066;"&gt;&lt;span style="font-size:13px;"&gt;)&lt;br /&gt;
    {&lt;br /&gt;
        ...&lt;br /&gt;
        AnimatedPos = &lt;span style="font-family:courier new;color:#000066;font-size:13px;"&gt;AnimControl&lt;/span&gt;.getHandMatrix(X); &lt;span style="color:#008000;"&gt;// here we go! the animated matrix...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&lt;span style="font-family:courier new;color:#000066;"&gt;        ...&lt;br /&gt;
    }&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now, on our GraphWeapon.Draw( ) method, instead of point the matrix acquired from the model like &lt;em&gt;world&lt;/em&gt; parameter, we provide the result from OriginalPos*AnimatedPos:&lt;br /&gt;
&lt;span style="font-family:courier new;font-size:13px;"&gt;&lt;span style="color:#000066;"&gt;    &lt;br /&gt;
    public &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;void&lt;/span&gt;&lt;span style="color:#000066;"&gt; Draw( &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;color:#000066;"&gt;&lt;span style="font-size:13px;"&gt;)&lt;br /&gt;
    {&lt;br /&gt;
        ...&lt;br /&gt;
        effect.Parameters[&lt;span style="color:#a31515;font-size:13px;"&gt;&amp;quot;World&amp;quot;&lt;/span&gt;].SetValue(&lt;strong&gt;OriginalPos&lt;/strong&gt; * &lt;strong&gt;AnimatedPos&lt;/strong&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size:13px;"&gt;&lt;span style="font-family:courier new;color:#000066;"&gt;        ...&lt;br /&gt;
    }&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Done, now we just need care about move and animate our heroes!&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;A small note: Inside your 3D package, your weapon&amp;#39;s pivot will be the point that will be attached, so if you use the character hand bone, you can consider pull your model pivot a bit forward or the weapon will be drawn on the middle of the character&amp;#39;s wrist. You can get this easily in 3dsMax using the Move tool and the Affect Pivot Only option from the hierarchy panel. &lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;</description></item></channel></rss>