<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Global to Local pos]]></title><description><![CDATA[<p dir="auto">Hi<br />
How to convert global position to local.<br />
I want to convert global position of Object to local position of his parent</p>
]]></description><link>http://developers.maxon.net/forum/topic/11320/global-to-local-pos</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 16:57:15 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/11320.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Feb 2019 15:46:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Global to Local pos on Sun, 10 Feb 2019 22:57:37 GMT]]></title><description><![CDATA[<p dir="auto">Thank you <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/mp5gosu">@<bdi>mp5gosu</bdi></a> <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--wink" style="height:23px;width:auto;vertical-align:middle" title=";)" alt="😉" /><br />
This is exactly what I was looking for.<br />
In fact, C4D does the calculations itself. I thought I had to do the matrix multiplication, and I didn't understand how to do it.<br />
Finally it's very simple <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>http://developers.maxon.net/forum/post/57156</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/57156</guid><dc:creator><![CDATA[Passion3D]]></dc:creator><pubDate>Sun, 10 Feb 2019 22:57:37 GMT</pubDate></item><item><title><![CDATA[Reply to Global to Local pos on Sun, 10 Feb 2019 18:40:50 GMT]]></title><description><![CDATA[<p dir="auto">Sorry, got you slightly wrong then.</p>
<p dir="auto">Try this:</p>
<pre><code class="language-python">    m = op.GetMg() # get the object's matrix
    m.off = c4d.Vector(50) # modify the position
    op.SetMg(m) #set the modified matrix
    c4d.EventAdd() # update C4D
</code></pre>
<p dir="auto">This code simply moves the child, completely decoupled from its parent in absolute world coordinates.</p>
]]></description><link>http://developers.maxon.net/forum/post/57155</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/57155</guid><dc:creator><![CDATA[mp5gosu]]></dc:creator><pubDate>Sun, 10 Feb 2019 18:40:50 GMT</pubDate></item><item><title><![CDATA[Reply to Global to Local pos on Sun, 10 Feb 2019 18:34:16 GMT]]></title><description><![CDATA[<p dir="auto">no, i want move the child but not the parent</p>
]]></description><link>http://developers.maxon.net/forum/post/57154</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/57154</guid><dc:creator><![CDATA[Passion3D]]></dc:creator><pubDate>Sun, 10 Feb 2019 18:34:16 GMT</pubDate></item><item><title><![CDATA[Reply to Global to Local pos on Sun, 10 Feb 2019 18:39:58 GMT]]></title><description><![CDATA[<p dir="auto">You don't have to!</p>
<p dir="auto">There's also a function available: <a href="https://developers.maxon.net/docs/py/2023_2/modules/c4d/C4DAtom/GeListNode/BaseList2D/BaseObject/index.html?highlight=setmg#BaseObject.SetMg" target="_blank" rel="noopener noreferrer nofollow ugc">SetMg()</a></p>
<p dir="auto">I warmly suggest you to read the <a href="https://developers.maxon.net/docs/py/2023_2/misc/matrixfundamental.html?highlight=setmg" target="_blank" rel="noopener noreferrer nofollow ugc">Matrix Fundamentals</a> since it has been written to demystify the matrix math. It also has various code examples for all kinds of transformations, including your scenario.</p>
<p dir="auto">edit: Now that I think about your question: Do you want to move the parent with the child?</p>
]]></description><link>http://developers.maxon.net/forum/post/57153</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/57153</guid><dc:creator><![CDATA[mp5gosu]]></dc:creator><pubDate>Sun, 10 Feb 2019 18:39:58 GMT</pubDate></item><item><title><![CDATA[Reply to Global to Local pos on Sun, 10 Feb 2019 18:20:16 GMT]]></title><description><![CDATA[<p dir="auto">My question may not be clear enough.<br />
I have an object1 that has a child Object2<br />
I want to move Object2 to a global position, so I have to convert the global position from destination to local position with respect to its parent.</p>
]]></description><link>http://developers.maxon.net/forum/post/57152</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/57152</guid><dc:creator><![CDATA[Passion3D]]></dc:creator><pubDate>Sun, 10 Feb 2019 18:20:16 GMT</pubDate></item><item><title><![CDATA[Reply to Global to Local pos on Sun, 10 Feb 2019 18:04:17 GMT]]></title><description><![CDATA[<p dir="auto">No problem. <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Now to your question: You can simply call <a href="https://developers.maxon.net/docs/py/2023_2/modules/c4d/C4DAtom/GeListNode/BaseList2D/BaseObject/index.html?highlight=getml#BaseObject.GetMl" target="_blank" rel="noopener noreferrer nofollow ugc">GetMl()</a> on your child object.  This returns you the local matrix of the object. Now to access the position, ask the matrix for the offset:</p>
<pre><code class="language-python">myObject.GetMl().off
</code></pre>
<p dir="auto">It's the very first example code in the documentation I linked in my previous post.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/passion3d">@<bdi>passion3d</bdi></a> said in <a href="https://developers.maxon.net/forum/post/57149" target="_blank" rel="noopener noreferrer nofollow ugc">Global to Local pos</a>:</p>
<blockquote>
<p dir="auto">google translate isn't always correct</p>
</blockquote>
<p dir="auto">You should try <a href="https://www.deepl.com/translator" target="_blank" rel="noopener noreferrer nofollow ugc">Deepl</a></p>
]]></description><link>http://developers.maxon.net/forum/post/57150</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/57150</guid><dc:creator><![CDATA[mp5gosu]]></dc:creator><pubDate>Sun, 10 Feb 2019 18:04:17 GMT</pubDate></item><item><title><![CDATA[Reply to Global to Local pos on Sun, 10 Feb 2019 17:05:20 GMT]]></title><description><![CDATA[<p dir="auto">I'm not an expert in math <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--wink" style="height:23px;width:auto;vertical-align:middle" title=";)" alt="😉" /> i tried but don"t work<br />
My english is null and google translate isn't always correct<br />
Can you give me an example?</p>
]]></description><link>http://developers.maxon.net/forum/post/57149</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/57149</guid><dc:creator><![CDATA[Passion3D]]></dc:creator><pubDate>Sun, 10 Feb 2019 17:05:20 GMT</pubDate></item><item><title><![CDATA[Reply to Global to Local pos on Sun, 10 Feb 2019 16:47:04 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://developers.maxon.net/docs/py/2023_2/misc/matrixfundamental.html?highlight=getmg" target="_blank" rel="noopener noreferrer nofollow ugc">Here</a> you will find any information about matrices and thus everything about positioning, scaling, rotation, etc.</p>
]]></description><link>http://developers.maxon.net/forum/post/57148</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/57148</guid><dc:creator><![CDATA[mp5gosu]]></dc:creator><pubDate>Sun, 10 Feb 2019 16:47:04 GMT</pubDate></item></channel></rss>