3
$\begingroup$

enter image description here

The documentation about this node says:

The Align Euler to Vector node rotates an Euler rotation into the given direction

It rotates a rotation... this might be understood as the mathematical composition of two rotations. Is this correct in spite one input, Vector, is a vector, not a rotation?

Assuming this is correct, I have two linked questions:

  • Rotation is often seen unconnected in tutorials. What is the default value? Is this a tuple of three null Euler angles?

  • How is the Vector input converted into a rotation to rotate the Rotation input as the documentation says. Is it for example the transformation required to rotate a local vertical unit vector $(0,0,1)$ and make it parallel to Vector $(x,y,z)$?

In addition, which node output can be connected to Rotation? It seems only another Align Euler to Vector output has the proper socket type, which would mean the first node must have an unconnected Rotation socket.


I'm adding this file which I used to interactively change the input Rotation and Vector, and see how the node output changes the orientation of cylinder instances.

Use the two empties to change Rotation and Vector in the node:

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

To answer your questions succinctly:

"Rotation is often shown disconnected in tutorials. What is the default value? Is it a tuple of three zero Euler angles?"

Yes, if there is no input here, a zero rotation is assumed that exactly matches the global coordinate system. So no rotation on any of the three axes.

"How is the vector input transformed into a rotation to rotate the rotation input, as it says in the documentation. For example, is it the transformation needed to rotate a local vertical unit vector $(0,0,1)$ and make it parallel to the vector $(x,y,z)$?"

The result describes a transformation that comes about by aligning a given axis (option X, Y, or Z) of an existing rotation (Rotation input) in the direction of a given vector (Vector input). However, this realignment is also calculated by rotating on a given other axis (option Pivot). So here no vector is converted, but a given rotation is changed in the direction of the vector and output in an Euler rotation.

In Detail

I'll try a simplified (hopefully understandable) explanation here...

What is a "Vector"?

Simply put, a Vector simply describes a direction with a specific magnitude in three-dimensional space based on coordinates. A single pointer pointing in a single specific direction and its starting point is always at $(0,0,0)$.

However, in many cases, so also in this one, only the direction of the vector is decisive, and not its magnitude, which is why here always normalized vectors are calculated, which have a length of $1$.

What is meant here at all by "Rotation"?

To even understand what a Rotation is and how to deal with it, you should know how it comes about in the first place. The manual input of a Rotation is done by the rotation on the axes X, Y and Z in degrees. However, if you look at the Rotation of an object in the spreadsheet, it does not necessarily correspond to the numerical values that you entered before, as the following example illustrates:

enter image description here

Here, the values $(101°, 141°, 190°)$ were entered manually, but the spreadsheet says $(-79°, 39°, 10°)$. This is because Blender internally calculates a Rotation using Quaternions.

In three-dimensional space, rotations can only be described reliably via those "Quaternions", since a representation via Euler angles on the axes X, Y, and Z would inevitably lead to the Gimbal Lock, where rotations with respect to certain axes can no longer be realized with the help of rotation operators for previously defined axes.

As the name "Quaternions" already suggests, this results in a four-dimensional number system (a vector space).

That's why there are four values (X, Y, Z, W) to describe a quaternion, which are not the same as Euler Angles, which are also called X, Y, Z, but describe something completely different!

A rotation calculated with quaternions can be correctly translated into Euler angles at any time, and this is what we see as "Rotation" in Geometry Nodes.

If different values are now added to this value, which consists of three components, then a new Euler rotation results, which Blender then translates back into quaternions.

A Rotation describes a rotation in the three-dimensional space and consists of three axes (three normalized vectors for X, Y and Z!), which stand to each other always in the same relationship. This results in a global and a local coordinate system, because both systems describe three directions at the same time.


So we have two different things here:

  • A Vector describes a direction (e.g. the normal of a face).
  • Rotation describe the rotation of an object in three-dimensional space.

The context in this case is:

A Rotation (i.e. describing a rotation around three-dimensional space), can be rotated in another direction, resulting in a new Rotation.

How does this work concretely?

As you can read in the documentation, the node Align Euler to Vector creates a Rotation, not a direction. This Rotation can be used to rotate other objects, for example.

The node assumes a zero Rotation as input rotation, i.e. if nothing is plugged into the input "Rotation". So the Rotation describes an unrotated object that is simply aligned to the global axes. Up is up, left is left, right is right, and so on. So, in Euler angle terms, this is $(0, 0, 0)$. Note also that although these values describe an "Euler rotation", in reality the angle is always captured in Radians.

The input Vector describes the direction to which this Rotation should be aligned or rotated, or formulated into a command: Rotate the Rotation described in Euler angle in another direction.

If there is also no value at the input Vector, this Rotation does not change either, and it remains at $(0, 0, 0)$.

But if the Rotation with $(0, 0, 0)$ describes that the Z-axis is oriented upwards, and the vector points to $(1, 0, 0)$, a rotation can take place, but for this one must additionally describe which axis is the rotation axis.

This is exactly what the value Pivot does. Along this defined axis the Rotation is additionally rotated. With the value "Auto" Blender decides for you which axis would be the "optimal" axis to get the desired Rotation.

In addition to the Pivot you have to define which of the axes described in the Rotation should be rotated in the direction of the given vector, because a Rotation describes three axes.

And exactly this is defined with Axis.

An example

If we rotate an object on the Z axis by $45°$, then this Rotation is described in Euler angles as $(0, 0, 0.785)$ (Radians again).

So, assuming the Rotation is $(0, 0, 0.785)$ and the applied vector points to $(0, 1, 1)$, and it has been set as Pivot X and as Axis Z, then the following happens:

  • It will rotate the direction Z (which points exactly up), at the local axis X in the direction $(0, 1, 1)$ for the given Rotation. Thus, all other axes rotate according to this new alignment.

It is important to emphasize here that the rotation takes place at the local axis of the described Rotation!

The result is therefore a new Rotation, whose Z-axis points to $(0, 1, 1)$ and which can be immediately transferred to another object (for example with the node Transform).

If one transfers this Rotation e.g. to an object, whose rotation is also at $(0, 0, 0)$, thus was not rotated, this points afterwards in the same direction of the vector used before, since it is rotated likewise on the X-axis accordingly into this direction.

If you convert this example into a simple experimental setup, it looks like this:

enter image description here

As you can see in this example, I am using the rotation of an "Empty" as the base Rotation for the arrow to be aligned. So you can plug in any Euler rotation to the input "Rotation".

Of course, you could also plug a vector into the input "Rotation", since this also has three values for the three axes, but this would then have to describe a correct Euler rotation instead of coordinates.

A use case that is often seen is the transfer/modification of the rotations at points of a curve (e.g. Curve to Points). Here each point has its own Rotation, thus its own local coordinate system, which results from tangents and normals.

What is local and global/parent?

As can be seen from the comments, my attempt at an explanation raised more questions than it answered, so the following addition:

Just imagine a ball with its local coordinate system (the three axes $(X,Y,Z)$). This ball is on the ISS and rotates on a certain axis in weightlessness.

In relation to the ISS, which is the parent coordinate system for the ball, the ball is rotated in relation to the coordinate system of the ISS.

So far logical.

But the ISS moves circularly around the earth, and the earth rotates around the sun and so on. This means: nested rotations arise, and it is not possible to calculate the rotation of the ball with Euler rotations (because of the mentioned Gimbal Lock). Therefore it is important to understand how rotations are calculated.

That is why the mention of quaternions.

A vector can be grasped more clearly. A rotation, which basically treats three direction vectors as a system, it is already more difficult to imagine. But both handle in Geometry Nodes a package of information consisting of three float values. The node and some inputs/outputs are labeled "Vector", but they are basically just a term for a packet of data consisting of three values, which is treated differently depending on the use case. In Align Euler to Vector, "Rotation" is a data packet described with Euler angles consisting of three float values, and "Vector" is a normalized direction vector, also consisting of three float values.

Therefore, this explanation applied to the ball in the ISS means:

The ball has a local coordinate system consisting of $(X,Y,Z)$. Its rotation around its own axis is described in this coordinate system. This however is part of the coordinate system of the ISS. So, in relation to the ball, this would be the global coordinate system. And the ISS has however its own local coordinate system, which is in constant rotation around the earth, which has again a local coordinate system and represents a global one for the ISS. and so on.

The largest imaginable unchangeable space is thus the "most global" coordinate system for all objects rotating nested within it. In Blender this limit is easier to grasp than in the universe.

Therefore, a rotation is always a question of the reference point, and this is exactly what the handling of Align Euler to Vector is about.

Therefore, it seemed important to me to convey what the difference between the three float values is. ...and with a *Rotation" these float values result from a quaternion.

Even if no (reasonable) person calculates with quaternions directly (and wants to calculate), it helps to understand, that an Euler rotation always represents only an image of this value in the respective coordinate system with reference to a superordinate system. Pfhuu.


Please forgive my repeated use of the term "Rotation". ...unfortunately it could not be avoided 😄

$\endgroup$
14
  • $\begingroup$ Very nice explanation. But maybe you should extend it to: a vector can also describe a point (position) - not just a direction 😉 +1 $\endgroup$
    – Chris
    Aug 4 at 10:50
  • $\begingroup$ Or with other words: a vector consists of 3 values (in 3D space - it can of course have as many values as you like) which you can interpret as position - rotation - scale - or whatever 😀 $\endgroup$
    – Chris
    Aug 4 at 10:52
  • 2
    $\begingroup$ @Chris Thank you! Strictly speaking, a Vector describes a direction with a certain magnitude, which results in a Position. But in this case, it's just a normalized direction. So a "Vector" is actually not a "Rotation". But a set of three values in Geometry Nodes is called such. But three values can describe several things: a direction, a position, but also an Euler rotation. This is exactly why it is often confusing: there are always three values, but depending on the use case, these three values describe different things. $\endgroup$
    – quellenform
    Aug 4 at 10:56
  • $\begingroup$ maybe this helps a bit: en.wikipedia.org/wiki/Euclidean_vector#cite_note-1 $\endgroup$
    – Chris
    Aug 4 at 11:16
  • 2
    $\begingroup$ @Chris Yes, you are absolutely right, the position describes of course this direction and in consequence the length/magnitude of the vector. That is correct. But to take up your example ($(0,1,1)$ and $(0,2,2)$): These are both the same directions, but different lengths of the vector, which results in different positions. Or different positions, resulting in different lengths. If you use these two positions/vectors with Align Euler to Vector, the result will always be the same, although the positions are different. Why? Because the (normalized) direction vector is always the same. $\endgroup$
    – quellenform
    Aug 4 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.