Jump to content

How to rotate an object so that it aligns with a different axis on another object?


Vulpinus
 Share

You are about to reply to a thread that has been inactive for 2587 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

ETA: Never mind - I got it. Confucius say: make sure to get the operands the right way around the *. Well, he actually said, "Don't quote me".

 

This is boggling my head. After two hours I've hit the whisky and decided to ask for help...

I have a linkset , A, with which I need a script to align a second linkset, B, with, but not with the same axes. The two linksets' roots have different rotatons when in position and I can't change that easily.

With A aligned with the world, and B in position, B's rotation in the edit box is <0,90,0>. When switched to local, B's Z axis moves to where the world X axis was, and B's X axis points down, aligned with the world Z but downwards.

Why does something that looks so simple cause me so much of a headache?

My script needs to rotate B when A is rotated into any orientation (A sends a message telling its rotation when it changes - no problems there) so that it remains in the same orientation with respect to A, as if they are joined (which they cannot be).

At least their roots are centered together; I'm grateful for small mercies.

Please help before I finish my bottle of Macallan :)

Link to comment
Share on other sites

I really don't see how the script would help... a diagram maybe, but not the script.

The script in A simply sends its root's rotation in a message to B, when the rotation has changed.

I need to know how to transform that rotation into a rotation that realigns B with A.

Really, there is nothing in the script that's anything to do with that part of things. That's what I need to know. Everything I have tried does not work, so what's the point of copying a dozen or so failed transformation formulae?

As an example of what I'm trying to do, imagine an aeroplane with a propeller which is not actually attached. The propeller has its Z axis aligned with the plane's X axis. Their Y axes coincide. I need to be able to rotate the propeller so that it stays in the correct rotation relative to the aeroplane when it rotates.*

No translation is needed; the roots are centered together.

 

*ETA: A better example, given that the roots coincide, would be a fan inside it's housing. Move the fan housing, and I need to move the fan blades to match.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2587 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...