<?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[Changing axis rotation position]]></title><description><![CDATA[<p dir="auto">What I'm trying to do is a python tag that wobbles a cube inside a null - so in fact wobbles the null itself. <img src="/forum/assets/uploads/files/1708026935404-vector-01.png" alt="vector-01.png" class=" img-fluid img-markdown" /><br />
The rotation axis is centered on the cube's base. When it's at 0 degrees that's its axis rotation. However when it's below, the axis moves to one corner, and then the opposite happens for positive rotation.</p>
<p dir="auto">I would like to know how I can find out and offset that would allow me to rotate the black cube around the base center and then move it to the position it would have if it rotated around the corner. So basically the V vector on the drawing.</p>
<p dir="auto">Unless there's a better way of changing the pivot point.</p>
]]></description><link>http://developers.maxon.net/forum/topic/15380/changing-axis-rotation-position</link><generator>RSS for Node</generator><lastBuildDate>Thu, 18 Jun 2026 04:43:12 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/15380.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Feb 2024 19:58:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Changing axis rotation position on Fri, 16 Feb 2024 17:12:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/ferdinand">@<bdi>ferdinand</bdi></a> I've played with your idea for a bit and then realized, that the point where the adj meets the ground is wrong, as it should be the point where a circle or f = opp with center in O meets the ground. Eventually I decided to just hack it a bit and change the position of the rotating object and the object inside to counter that move. Here's the result:</p>
<p dir="auto"><video class="embed-video-local" controls src="/forum/assets/uploads/files/1708103545374-cards_script_v06-thickness.mp4">
</video></p>]]></description><link>http://developers.maxon.net/forum/post/73782</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73782</guid><dc:creator><![CDATA[SweepingMotion]]></dc:creator><pubDate>Fri, 16 Feb 2024 17:12:30 GMT</pubDate></item><item><title><![CDATA[Reply to Changing axis rotation position on Fri, 16 Feb 2024 13:11:38 GMT]]></title><description><![CDATA[<p dir="auto">My pleasure, and two answer you other question, yes, there are probably half a dozen ways to do this. The big alternative would be using transforms only and simply shifting to origin of operation to one of the corners of the cube before rotating it, and then move it. But these are all math questions, and SDK cannot teach users math.</p>
<p dir="auto">But at least I would consider trigonometry in this case the easiest solution although I am usually not a big fan of excessive trigonometry usage, e.g., constructing rotation matrices by hand and so on.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/73779</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73779</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Fri, 16 Feb 2024 13:11:38 GMT</pubDate></item><item><title><![CDATA[Reply to Changing axis rotation position on Fri, 16 Feb 2024 12:52:58 GMT]]></title><description><![CDATA[<p dir="auto">Thank you</p>
]]></description><link>http://developers.maxon.net/forum/post/73778</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73778</guid><dc:creator><![CDATA[SweepingMotion]]></dc:creator><pubDate>Fri, 16 Feb 2024 12:52:58 GMT</pubDate></item><item><title><![CDATA[Reply to Changing axis rotation position on Fri, 16 Feb 2024 13:04:00 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/sweepingmotion">@<bdi>SweepingMotion</bdi></a>,</p>
<p dir="auto">I cannot help you more with the math, as such topics are out of scope of support. There is nothing special about how to construct the vector in our APIs.</p>
<p dir="auto">You can either rotate a unit vector scaled to length, here assuming that up is the y-axis and alpha the z-axis.</p>
<pre><code class="language-py">v: c4d.Vector = c4d.Vector(0, length, 0) * c4d.utils.MatrixRotZ(alpha)
</code></pre>
<p dir="auto">Or you can just scale the axis component of the global/local transform of your rectangle which is parallel with your <code>v</code>. I am again assuming that the local up is along <code>y</code> for your rectangle. This only works when the respective axis component is really parallel to v, but I assume that is the case here.</p>
<pre><code class="language-py"># I operate here in global space, you could also do this locally.
mg: c4d.Matrix = rectangle.GetMg() #The global transform of the rectangle.
j: c4d.Vector = mg.v2.GetNormalized() # Its normalized v2/j/y component, its "y-axis"  
v: c4d.Vector = j * length

# Or in one go
v: c4d.Vector = rectangle.GetMg().v2.GetNormalized() * length
</code></pre>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/73777</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73777</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Fri, 16 Feb 2024 13:04:00 GMT</pubDate></item><item><title><![CDATA[Reply to Changing axis rotation position on Fri, 16 Feb 2024 10:16:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/mogh">@<bdi>mogh</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/ferdinand">@<bdi>ferdinand</bdi></a><br />
I'm building a python tag to handle these cards:<br />
<a href="/forum/assets/uploads/files/1708076903443-cards_script_v01.mp4">cards_script_v01.mp4</a><br />
Works quite well when cards are flat. But I'd like to add some thickness. At the moment when crossing the vertical I move the top object to where the pivot should be and move the inside object in the opposite direction:<br />
<a href="/forum/assets/uploads/files/1708077026171-cards_script_v01-thickness.mp4">cards_script_v01-thickness.mp4</a><br />
I was wondering though if there might be a better way of doing it.<br />
The image in my original post was showing the situation - rotation around the central point at the base vs rotation around the corner of the base. Sorry if I didn't make myself clear.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/ferdinand">@<bdi>ferdinand</bdi></a> How would I construct this vector in c4d in python?</p>
]]></description><link>http://developers.maxon.net/forum/post/73776</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73776</guid><dc:creator><![CDATA[SweepingMotion]]></dc:creator><pubDate>Fri, 16 Feb 2024 10:16:16 GMT</pubDate></item><item><title><![CDATA[Reply to Changing axis rotation position on Fri, 16 Feb 2024 09:41:25 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/sweepingmotion">@<bdi>SweepingMotion</bdi></a>,</p>
<p dir="auto">Thank you for reaching out to us. This topic is out of scope of support because it is just a math question. I will answer here once, but for follow-up questions you would have to rely on the community.</p>
<h4>About your Question</h4>
<p dir="auto">Your question is ambiguous since you tell us what you want, <code>v</code>, but not what you know/have. Your image is also a bit confusing with the red and black rectangle being slightly offset on their local horizontal axis, but I assume that has been done to make the image more readable.</p>
<p dir="auto">I am going assume that you know the angle of your black rectangle in relation to the ground line and that you know the side length of the black rectangle.</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1708073584431-58fd4f93-3a0e-4b65-b97c-37115fdf25c5-image-resized.png" alt="58fd4f93-3a0e-4b65-b97c-37115fdf25c5-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This is then just a simple <a href="https://en.wikipedia.org/wiki/Trigonometric_functions" target="_blank" rel="noopener noreferrer nofollow ugc">trigonometric identity</a>. We have a point <code>O</code> which lies on a line <code>ground</code> and the line segment/vector <code>opp</code> originating from it, which is half the side length of your rectangle long. <code>ground</code> and <code>opp</code> form a right triangle with an angle <code>alpha</code> between them. We can therefore use the tangent relation to compute the adjacent <code>adj</code> in this triangle whose length is identical to <code>v</code>.</p>
<p dir="auto"><code>v</code> is a vector with the length <code>opp/tan(alpha)</code> and the orientation <code>alpha</code> in relation to the ground line.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/73775</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73775</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Fri, 16 Feb 2024 09:41:25 GMT</pubDate></item><item><title><![CDATA[Reply to Changing axis rotation position on Fri, 16 Feb 2024 07:42:35 GMT]]></title><description><![CDATA[<p dir="auto">I do not fully understand the goal with the black center, why not always have two(left / right)  red dots as pivot axis ?<br />
Even though it might be clunky, have you tried to prototype your concept in X-Presso ? or even mechanical rigging. There was a good Maxon (by Noseman) tutorial on youtube a few weeks ago.</p>
]]></description><link>http://developers.maxon.net/forum/post/73772</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73772</guid><dc:creator><![CDATA[mogh]]></dc:creator><pubDate>Fri, 16 Feb 2024 07:42:35 GMT</pubDate></item></channel></rss>