3
$\begingroup$

I have a vector V = (x, y, z) and I need to rotate an object in the direction of this vector. I can do that by calculating the rotation R using Align Euler to Vector node. But if I further want to rotate the same object along the same direction by theta radians, what's the way to do that?

I tried adding / multiplying theta to the original Vector V as well as the resulting Rotation R; that doesn't seem to help.

$\endgroup$

2 Answers 2

4
$\begingroup$

Multiplying an Euler rotation won't extrapolate the rotation in the way you want, because Euler rotations are sets of 3 rotations done in a sequence, so rotating by a multiplied Euler will stack first x rotations, then y rotations, then z rotations…

But instead of stacking it this way:

xxxxxxxxxxyyyyyyyyyyzzzzzzzzzz

You want to stack it this way:

xyzxyzxyzxyzxyzxyzxyzxyzxyzxyz

For a smooth animation you could take a cross product, and rotate around the custom axis:

Fine, but what if you don't know the angle to reach the target and want to operate on multiples of that? for example what if you want to extrapolate only up to a factor of $3$, which means a 3 times more rotation than the one needed to point at the target? Speaking of the factor - this input socket is interesting:

If only there was a way to go outside $[0, 1]$ range to extrapolate…

$\endgroup$
4
$\begingroup$

i am not sure whether this is what you want, but the align euler to vector node calculates an absolute value as rotation for a direction. So if you really wanna make an animation out of this, e.g. rotate from +z to -z via +y, you could use a node tree like this:

enter image description here

result:

enter image description here

Here i first animate the direction/rotation change from +z to +y via the first mix node. Then i animate the direction/rotation change from +y to -z via the second mix node.

So you basically animate the direction vectors and change these over time to get the rotation.

There might be other/better ways, but that's one way i know.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .