<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Rotation offset]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=816&amp;type=atom"/>
	<updated>2013-10-16T16:16:49Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=816</id>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5564#p5564"/>
			<content type="html"><![CDATA[<p>I did it!</p><div class="codebox"><pre><code>        MVector3 cross = A.crossProduct(B);
        if(A.dotProduct(cross) &lt; 0)
            angle = -angle;
        offsetAxis = cross;
        offsetAxis.normalize();
        offsetAngle = float(angle * RAD_TO_DEG);</code></pre></div><p>I did<br /></p><div class="codebox"><pre><code>if(B.dotProduct(cross) &lt; 0)</code></pre></div><p>That&#039;s wrong. To find the sign you have to do the dot product of Vn and the cross product, where Vn is the vector normal, which is basically the axis that you first used for reference.</p><p>I also did the cross product wrong. It is not commutative so you have to be careful if you do AXB or BXA.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-16T16:16:49Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5564#p5564</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5562#p5562"/>
			<content type="html"><![CDATA[<p>Yes, reading the source file that you&#039;ve posted I noticed RAD_TO_DEG.<br /></p><div class="quotebox"><blockquote><p>the base of your code is ok</p></blockquote></div><p>Nice to know. What I&#039;m trying to do is explained here: <a href="http://forum.maratis3d.com/viewtopic.php?pid=5545#p5545">http://forum.maratis3d.com/viewtopic.php?pid=5545#p5545</a><br />Since the mesh file may have a mesh a bit rotated (not perfectly looking towards one of the axis), I need to adjust that.<br />How can I do it?<br />1) rotating the mesh itself editing the vertices<br />or<br />2) adding a rotation offset to the bone associated with the ragdoll part (what I&#039;m currently trying to do).</p><p>My code for finding the offset is now the following. It only runs one time, at the ragdoll creation, and saves the offset data in a class which manages the ragdoll part (the forearm in this case).<br /></p><div class="codebox"><pre><code>//find the angle between the elbow and the wrist bones (I&#039;ve tried both local and relative coordinates)
    MVector3 AxisYPoint = elbowBonePos;
    AxisYPoint.y = 1000;
    MVector3 A = AxisYPoint - elbowBonePos;  //vector A
    MVector3 B = wristBonePos - elbowBonePos;               //vector B
    A.normalize();
    B.normalize();

//find the angle
    float dp = A.dotProduct(B);
    float angle = acos(dp);

//find the sign of the angle
    MVector3 cross = B.crossProduct(A);
    if(B.dotProduct(cross) &lt; 0)
        angle = -angle;

    ragdollPart-&gt;angle = float(angle * RAD_TO_DEG);
//find the axis
    ragdollPart-&gt;axis = cross;</code></pre></div><p>The code for moving the bone is the following one (the first part is basically the code you gave me in another topic):<br /></p><div class="codebox"><pre><code>            //rotate the bone
            MMatrix4x4 myMatrix = character_using_the_ragdoll-&gt;getMatrix()-&gt;getInverse() * (*ragdollPart-&gt;entity-&gt;getMatrix());
            MObject3d * parentBone = bone-&gt;getParent();
            if(parentBone)
            {    //calculate object matrix in parentBone&#039;s space coordinate
                myMatrix = parentBone-&gt;getMatrix()-&gt;getInverse() * myMatrix;
            }
            //get rotation coords from myMatrix
            bone-&gt;setEulerRotation(myMatrix.getEulerAngles());


            //add offset (that I calculated before)
            bone-&gt;addAxisAngleRotation(ragdollPart-&gt;offsetAxis,ragdollPart-&gt;offsetAngle);</code></pre></div><p>There is a lot of code of course that I&#039;m not showing, where I set the physics properties and do other things, but everything is working. If I don&#039;t do this &quot;offset thing&quot; all the ragdoll is working fine and the arm is swinging around the pivot and the skeleton is correctly updated, but the skeleton forearm is slightly off in respect to the ragdoll part forearm, and this is what I was trying to solve.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-16T13:27:04Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5562#p5562</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5560#p5560"/>
			<content type="html"><![CDATA[<p>yes the angle is in degree,<br />the base of your code is ok, you do a cross-product to find the rotation axis<br />and a dot product to find the angle.</p><p>by the way there is some macro for degree/radians conversion in MCore :<br />DEG_TO_RAD and RAD_TO_DEG (ex : degree = radian*RAD_TO_DEG;)</p><p>after, I&#039;m not sure to understand what you want to do with an offset<br />so it&#039;s possible that you have a problem on this part.</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2013-10-16T12:39:17Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5560#p5560</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5559#p5559"/>
			<content type="html"><![CDATA[<p>I&#039;ve tried using local points but no luck.<br />What kind of values does setAxisAngleRotation() expects for the angle? e.g. float from 0 to 359<br />Just to know if I have the angle right.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-16T07:36:57Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5559#p5559</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5555#p5555"/>
			<content type="html"><![CDATA[<p>I think AxisYPoint or P and Q might be wrong,<br />they all need to be in the same coordinate, meaning global or local.</p><p>so, or you make AxisYPoint global, or you make Q and P local.</p><p>you can look at the code of the look-at behavior : <a href="https://maratis.googlecode.com/svn/trunk/dev/Maratis/Common/MBehaviors/MBLookAt.cpp">https://maratis.googlecode.com/svn/trun &#133; LookAt.cpp</a></p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2013-10-15T20:27:08Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5555#p5555</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5554#p5554"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>zester wrote:</cite><blockquote><p>But regardless the info posted is still relevant.</p></blockquote></div><p>Sure, I didn&#039;t get mad, I was just pointing out what you were not understanding. The lua-code-misinterpretation makes everything clear now. It&#039;s just hard to show our mood via forum text, but you can stay assured that my mood is always quiet and calm. <img src="http://forum.maratis3d.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-15T18:43:41Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5554#p5554</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5553#p5553"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>255 wrote:</cite><blockquote><p>The code I&#039;ve posted is not LUA.</p></blockquote></div><p>My bad your correct its C, It looked like Lua at first glance. I just read it to see what you were trying to do. Didn&#039;t notice you declaring types and the C++ &quot;//&quot; comments sorry. But regardless the info posted is still relevant.</p>]]></content>
			<author>
				<name><![CDATA[zester]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=516</uri>
			</author>
			<updated>2013-10-15T18:21:46Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5553#p5553</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5552#p5552"/>
			<content type="html"><![CDATA[<p>The code I&#039;ve posted is not LUA, it&#039;s C++.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-15T18:21:37Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5552#p5552</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5550#p5550"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>255 wrote:</cite><blockquote><div class="quotebox"><cite>zester wrote:</cite><blockquote><p>You do know that when you start messing with the pivot point your bounding box for each object modified is going to change its scale and transformation right?</p></blockquote></div><p>Not when you use the collision shape convex-hull.</p><p>You should more carefully read my posts BTW. You missed this important part:<br /></p><div class="codebox"><pre><code>start the physics context and enjoy how everything is working fine and the forearm swings</code></pre></div><p>Which, in other words, means that <strong>my ragdoll code WORKS</strong>.<br />The problem is only when the mesh is a bit rotated (not facing the axis perfectly).<br />If I use a forearm mesh correctly rotated then my code does work. But I want my game to be able to accept and adapt to any meshes.</p><div class="quotebox"><blockquote><p>Normally you wouldn&#039;t even use a ragdoll in a game, they exist for...</p></blockquote></div><p>You are again forcing me to say &quot;I know my stuff&quot;. I can&#039;t write yet another wall of text just to explain all my project goals. This topic is just to ask specific help on a very specific task.</p><div class="quotebox"><blockquote><p>What you want doesn&#039;t have lua bindings yet &quot;MArmature&quot; and &quot;MSkinData&quot; I think &quot;MSkinPoint * m_points;&quot; is the&nbsp; Bone&#039;s Transformation Matrice. If so thats what you would be wanting to tweek I do believe.<br />How is your C++?</p></blockquote></div><p>Again, you have not read my posts carefully, since it&#039;s obvious that I&#039;m using C++ and nothing else, with MArmature, MBones, etc.<br />This time you missed another line:<br /></p><div class="codebox"><pre><code>update the skeleton to match the rotation of the ragdoll part</code></pre></div></blockquote></div><p>This isn&#039;t a pissing contest, don&#039;t take anything I am posting to heart, I post the information regardless if you know it or not, for myself and others to look back on. Someone might come along who&#039;s messing with ragdolls has a problem but doesn&#039;t particularly want to solve it the same way you are.</p><p>The code you post above was lua, that doesn&#039;t translate into &quot;I am only using C++ and nothing&quot; else that translates into &quot;My lua code isn&#039;t working&quot; if you already know about &quot;MArmature&quot; and &quot;MSkinData&quot; and are using C++ then you should know how to solve your problem. I posted every last bit of info I had on the topic.</p><p>Anael is the only one here who might be able to help you.</p>]]></content>
			<author>
				<name><![CDATA[zester]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=516</uri>
			</author>
			<updated>2013-10-15T18:17:26Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5550#p5550</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5549#p5549"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>zester wrote:</cite><blockquote><p>You do know that when you start messing with the pivot point your bounding box for each object modified is going to change its scale and transformation right?</p></blockquote></div><p>Not when you use the collision shape convex-hull.</p><p>You should more carefully read my posts BTW. You missed this important part:<br /></p><div class="codebox"><pre><code>start the physics context and enjoy how everything is working fine and the forearm swings</code></pre></div><p>Which, in other words, means that <strong>my ragdoll code WORKS</strong>.<br />The problem is only when the mesh is a bit rotated (not facing the axis perfectly).<br />If I use a forearm mesh correctly rotated then my code does work. But I want my game to be able to accept and adapt to any meshes.</p><div class="quotebox"><blockquote><p>Normally you wouldn&#039;t even use a ragdoll in a game, they exist for...</p></blockquote></div><p>You are again forcing me to say &quot;I know my stuff&quot;. I can&#039;t write yet another wall of text just to explain all my project goals. This topic is just to ask specific help on a very specific task.</p><div class="quotebox"><blockquote><p>What you want doesn&#039;t have lua bindings yet &quot;MArmature&quot; and &quot;MSkinData&quot; I think &quot;MSkinPoint * m_points;&quot; is the&nbsp; Bone&#039;s Transformation Matrice. If so thats what you would be wanting to tweek I do believe.<br />How is your C++?</p></blockquote></div><p>Again, you have not read my posts carefully, since it&#039;s obvious that I&#039;m using C++ and nothing else, with MArmature, MBones, etc.<br />This time you missed another line:<br /></p><div class="codebox"><pre><code>update the skeleton to match the rotation of the ragdoll part</code></pre></div>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-15T18:00:34Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5549#p5549</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5548#p5548"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>Tutorial Doctor wrote:</cite><blockquote><p>A drawn diagram of what you want to do would help me. I&#039;m sorta okay at calculus, but personally I like to find the easiest route. I don&#039;t get what you are trying to do.</p><p>When you say &quot;offset rotation&quot; what do you mean? And when you say you want to use the rotation &quot;between&quot; two objects, what do you mean?</p><p>Are you doing some sort of pendulum motion that has one object following the same rotation of a other, just offset by a certain angle?</p><p>For example, objec1 swings and then object2 swings just like object1, but the timing is offset?</p><p>Hmm, reminds me of that joints project that used behaviors to make a rag-doll looking effect.</p><p>Also, if the rotation is local, to the joint, why would it rotate the whole mesh?</p></blockquote></div><p>You are where I was two post ago TD lol, he wants to modify the rotation of the bones for his ragdoll cause its not looking right when it jiggles around.</p>]]></content>
			<author>
				<name><![CDATA[zester]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=516</uri>
			</author>
			<updated>2013-10-15T17:10:54Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5548#p5548</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5547#p5547"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>255 wrote:</cite><blockquote><div class="quotebox"><cite>zester wrote:</cite><blockquote><p>Ohhh and Mr I know my stuff</p></blockquote></div><p>With &quot;I know my stuff&quot; I just meant that I know that you can change the origin in Blender but I really needed to change it via code. I just meant that, sorry if it sounded snob. It was a way to say &quot;yep I know you can change it Blender but I really need to do it via code&quot;.</p><div class="quotebox"><cite>zester wrote:</cite><blockquote><p>The problem with your code is your trying to rotate an object from a pivot point that doesn&#039;t exist. I know you think you created it but you didn&#039;t.</p></blockquote></div><p>Thanks for the input.<br />But I think that the pivot does exist.<br />I&#039;ll try to give more information.<br />What I&#039;m trying to do is to create a complex ragdoll which loads a mesh as the bounding box for every part.<br />What I&#039;m doing is this:<br /></p><div class="codebox"><pre><code>say you have a lower arm and two bones, elbow and wrist
create a ragdoll part
set its origin the same as the wrist bone
set the part position in the position the same as the wrist bone minus the elbow bone
set the pivot constraint = position of elbow bone
update the skeleton to match the rotation of the ragdoll part
start the physics context and enjoy how everything is working fine and the arm swings</code></pre></div><p>but problem: if your ragdoll part mesh which is the lower arm is a bit rotated (in the mesh file), then your skeleton will rotate wrong. This is why I&#039;m trying to add to its rotation an offset rotation.<br />Or I could rotate the mesh itself, but this seems way harder.</p></blockquote></div><p>I mean your pivot exist just not ... never-mind doesn&#039;t matter.</p><p>You should have just said &quot;Ragdoll, Code, Not Working, HELP&quot; <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /> lol</p><p>I now see what your saying. Both solutions are incorrect thou, you wouldn&#039;t want to do ether. You do know that when you start messing with the pivot point your bounding box for each object modified is going to change its scale and transformation right?</p><p>Thats why I was say no no no no don&#039;t do that. Cause it will really mess with your physics. And then your ragdoll will really look bad.</p><p>Normally you wouldn&#039;t even use a ragdoll in a game, they exist for the purpose of recording a keyframed animation in your 3d package(blender) allowing you to simulate the physics of beating the crap out of a character to play back at a later time.</p><p>What you want doesn&#039;t have lua bindings yet &quot;MArmature&quot; and &quot;MSkinData&quot; I think &quot;MSkinPoint * m_points;&quot; is the&nbsp; Bone&#039;s Transformation Matrice. If so thats what you would be wanting to tweek I do believe.</p><p>How is your C++? I would say put in a request.</p><p>I am half tempted to just re-implement the lua bindings using luabind would only take a couple of hours to wrap maratis entire codebase.</p>]]></content>
			<author>
				<name><![CDATA[zester]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=516</uri>
			</author>
			<updated>2013-10-15T17:07:42Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5547#p5547</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5546#p5546"/>
			<content type="html"><![CDATA[<p>A drawn diagram of what you want to do would help me. I&#039;m sorta okay at calculus, but personally I like to find the easiest route. I don&#039;t get what you are trying to do.</p><p>When you say &quot;offset rotation&quot; what do you mean? And when you say you want to use the rotation &quot;between&quot; two objects, what do you mean?</p><p>Are you doing some sort of pendulum motion that has one object following the same rotation of a other, just offset by a certain angle?</p><p>For example, objec1 swings and then object2 swings just like object1, but the timing is offset?</p><p>Hmm, reminds me of that joints project that used behaviors to make a rag-doll looking effect.</p><p>Also, if the rotation is local, to the joint, why would it rotate the whole mesh?</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-10-15T16:53:41Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5546#p5546</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5545#p5545"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>zester wrote:</cite><blockquote><p>Ohhh and Mr I know my stuff</p></blockquote></div><p>With &quot;I know my stuff&quot; I just meant that I know that you can change the origin in Blender but I really needed to change it via code. I just meant that, sorry if it sounded snob. Since you said &quot;I am not sure I understand the logic behind...&quot; I was just trying to say &quot;yeah just trust me&quot; lol.</p><div class="quotebox"><cite>zester wrote:</cite><blockquote><p>The problem with your code is your trying to rotate an object from a pivot point that doesn&#039;t exist. I know you think you created it but you didn&#039;t.</p></blockquote></div><p>Thanks for the input.<br />But I think that the pivot does exist.<br />I&#039;ll try to give more information, I just didn&#039;t want the first post to be a wall of text, but I guess it&#039;s necessary.<br />What I&#039;m trying to do is to create a complex ragdoll which loads a mesh as the bounding box for every part.<br />What I&#039;m doing is this:<br /></p><div class="codebox"><pre><code>say you have a forearm and two bones, elbow and wrist
create a ragdoll part
set its origin the same as the wrist bone
set the part position in the position the same as the wrist bone
set the pivot constraint = position of elbow bone
update the skeleton to match the rotation of the ragdoll part
start the physics context and enjoy how everything is working fine and the forearm swings</code></pre></div><p>but problem: if your ragdoll part mesh which is the forearm is a bit rotated (in the mesh file), then your skeleton will rotate wrong. This is why I&#039;m trying to add an offset rotation to its rotation.<br />If you now look at the code in the first post, you will see that it makes more sense, given that point P is the elbow bone position and point Q is the wrist bone position.</p><p>An alternative is rotating the mesh itself, but this seems even harder because you have to change normals too, etc., but I may look into that too.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-15T16:25:01Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5545#p5545</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rotation offset]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5544#p5544"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>255 wrote:</cite><blockquote><p>I appreciate your help attempts, but please now don&#039;t go off-topic. ^ ^</p><p>I know my stuff, I need to edit the mesh via code because I&#039;m trying to do complex things and so the mesh must be manipulated by my game and not manually using Blender or other tools.<br />If you can find what&#039;s wrong in my above code, then post.<br />Thanks.</p></blockquote></div><p>The problem with your code is your trying to rotate an object from a pivot point that doesn&#039;t exist. I know you think you created it but you didn&#039;t. And it cant be done that way anyways. You do have some of the needed math (convert Degree&#039;s to Radiant and Divide Pi by 180 Degrees and Translate your Objects X, Y and Z Position in a loop)&nbsp; you need to calculate the path(X,Y and Z) and move your object along that path. You cant create an &quot;offset&quot; and try to rotate your object using it, because it doesn&#039;t actually exist. An Origin is actually two objects parented to each other. You then rotate the parent(origin) object. </p><p>You need a Tweening Library.</p><p>Other than that your code isn&#039;t going to work.</p><p>Ohhh and Mr I know my stuff your question, and even similar code examples have been posted in the past here on these vary forums. Thy knew there stuff two apparently, we need &quot;Rotation Offset&quot; in the freaking FAQ, with Diagrams on Why, Why Not and Alternative Methods. <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></content>
			<author>
				<name><![CDATA[zester]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=516</uri>
			</author>
			<updated>2013-10-15T11:58:49Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5544#p5544</id>
		</entry>
</feed>
